Fix password used in tests

This commit is contained in:
David Glick 2022-10-05 20:49:42 +02:00
parent 7a23fd9ad0
commit 3f8f647e03
No known key found for this signature in database
GPG Key ID: 8BD25BEDB449C4B0
2 changed files with 9 additions and 7 deletions

View File

@ -18,10 +18,11 @@ First we have to set up some things and login.
>>> app = layer['app'] >>> app = layer['app']
>>> from plone.testing.z2 import Browser >>> from plone.testing.z2 import Browser
>>> from plone.app.testing import SITE_OWNER_PASSWORD
>>> from plone.app.testing import TEST_USER_PASSWORD >>> from plone.app.testing import TEST_USER_PASSWORD
>>> browser = Browser(app) >>> browser = Browser(app)
>>> browser.handleErrors = False >>> browser.handleErrors = False
>>> browser.addHeader('Authorization', f'Basic admin:{TEST_USER_PASSWORD}') >>> browser.addHeader('Authorization', f'Basic admin:{SITE_OWNER_PASSWORD}')
>>> portal = layer['portal'] >>> portal = layer['portal']
>>> portal_url = 'http://nohost/plone' >>> portal_url = 'http://nohost/plone'
@ -241,7 +242,7 @@ Enable anonymous comment with email.
>>> browser.open(portal_url + '/logout') >>> browser.open(portal_url + '/logout')
>>> browser.open(portal_url + '/login_form') >>> browser.open(portal_url + '/login_form')
>>> browser.getControl(name='__ac_name').value = 'admin' >>> browser.getControl(name='__ac_name').value = 'admin'
>>> browser.getControl(name='__ac_password').value = TEST_USER_PASSWORD >>> browser.getControl(name='__ac_password').value = SITE_OWNER_PASSWORD
>>> browser.getControl('Log in').click() >>> browser.getControl('Log in').click()
>>> browser.open(portal_url+'/@@discussion-controlpanel') >>> browser.open(portal_url+'/@@discussion-controlpanel')
>>> browser.getControl(name='form.widgets.anonymous_comments:list').value = 'selected' >>> browser.getControl(name='form.widgets.anonymous_comments:list').value = 'selected'

View File

@ -15,10 +15,11 @@ First we have to set up some things and login.
>>> app = layer['app'] >>> app = layer['app']
>>> from plone.testing.z2 import Browser >>> from plone.testing.z2 import Browser
>>> from plone.app.testing import SITE_OWNER_PASSWORD
>>> from plone.app.testing import TEST_USER_PASSWORD >>> from plone.app.testing import TEST_USER_PASSWORD
>>> browser = Browser(app) >>> browser = Browser(app)
>>> browser.handleErrors = False >>> browser.handleErrors = False
>>> browser.addHeader('Authorization', f'Basic admin:{TEST_USER_PASSWORD}') >>> browser.addHeader('Authorization', f'Basic admin:{SITE_OWNER_PASSWORD}')
>>> portal = layer['portal'] >>> portal = layer['portal']
>>> portal_url = 'http://nohost/plone' >>> portal_url = 'http://nohost/plone'
@ -177,7 +178,7 @@ Enable anonymous comment
>>> browser.open(portal_url + '/logout') >>> browser.open(portal_url + '/logout')
>>> browser.open(portal_url + '/login_form') >>> browser.open(portal_url + '/login_form')
>>> browser.getControl(name='__ac_name').value = 'admin' >>> browser.getControl(name='__ac_name').value = 'admin'
>>> browser.getControl(name='__ac_password').value = TEST_USER_PASSWORD >>> browser.getControl(name='__ac_password').value = SITE_OWNER_PASSWORD
>>> browser.getControl('Log in').click() >>> browser.getControl('Log in').click()
>>> browser.open(portal_url+'/@@discussion-controlpanel') >>> browser.open(portal_url+'/@@discussion-controlpanel')
>>> browser.getControl(name='form.widgets.anonymous_comments:list').value = 'selected' >>> browser.getControl(name='form.widgets.anonymous_comments:list').value = 'selected'
@ -249,7 +250,7 @@ Log in as admin
>>> browser.getLink('Log out').click() >>> browser.getLink('Log out').click()
>>> browser.open(portal_url + '/login_form') >>> browser.open(portal_url + '/login_form')
>>> browser.getControl('Login Name').value = 'admin' >>> browser.getControl('Login Name').value = 'admin'
>>> browser.getControl('Password').value = TEST_USER_PASSWORD >>> browser.getControl('Password').value = SITE_OWNER_PASSWORD
>>> browser.getControl('Log in').click() >>> browser.getControl('Log in').click()
Use the Plone control panel to enable comment editing. Use the Plone control panel to enable comment editing.
@ -451,7 +452,7 @@ Login as admin.
>>> browser.open(portal_url + '/login_form') >>> browser.open(portal_url + '/login_form')
>>> browser.getControl(name='__ac_name').value = 'admin' >>> browser.getControl(name='__ac_name').value = 'admin'
>>> browser.getControl(name='__ac_password').value = TEST_USER_PASSWORD >>> browser.getControl(name='__ac_password').value = SITE_OWNER_PASSWORD
>>> browser.getControl('Log in').click() >>> browser.getControl('Log in').click()
Edit the content object. Edit the content object.
@ -480,7 +481,7 @@ Edit the control panel.
>>> browser.open(portal_url + '/logout') >>> browser.open(portal_url + '/logout')
>>> browser.open(portal_url + '/login_form') >>> browser.open(portal_url + '/login_form')
>>> browser.getControl(name='__ac_name').value = 'admin' >>> browser.getControl(name='__ac_name').value = 'admin'
>>> browser.getControl(name='__ac_password').value = TEST_USER_PASSWORD >>> browser.getControl(name='__ac_password').value = SITE_OWNER_PASSWORD
>>> browser.getControl('Log in').click() >>> browser.getControl('Log in').click()
>>> browser.open(portal_url+'/@@discussion-controlpanel') >>> browser.open(portal_url+'/@@discussion-controlpanel')
>>> browser.getControl(name='form.widgets.anonymous_email_enabled:list').value = 'selected' >>> browser.getControl(name='form.widgets.anonymous_email_enabled:list').value = 'selected'