diff --git a/CHANGES.rst b/CHANGES.rst index f933116..a4ab608 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -18,6 +18,9 @@ Bug fixes: default values, which actually works [tomgross] +- Use test browser from plone.testing for compatibility with Zope 4 + [davisagli] + 2.0.14 (2017-02-05) ------------------- diff --git a/plone/schemaeditor/tests/choice.rst b/plone/schemaeditor/tests/choice.rst index 5d7b284..d2d665e 100644 --- a/plone/schemaeditor/tests/choice.rst +++ b/plone/schemaeditor/tests/choice.rst @@ -13,9 +13,10 @@ schema editor. >>> user = app.acl_users.userFolderAddUser( ... 'root', 'secret', ['Manager'], []) + >>> import transaction; transaction.commit() - >>> from Testing import testbrowser - >>> browser = testbrowser.Browser() + >>> from plone.testing.z2 import Browser + >>> browser = Browser(app) >>> browser.handleErrors = False >>> browser.addHeader('Authorization', 'Basic root:secret') diff --git a/plone/schemaeditor/tests/editing.rst b/plone/schemaeditor/tests/editing.rst index aec9848..9d230b7 100644 --- a/plone/schemaeditor/tests/editing.rst +++ b/plone/schemaeditor/tests/editing.rst @@ -5,8 +5,8 @@ will print out the event, so that we can make sure events are getting raised pro Let's set up the test browser:: - >>> from Testing.testbrowser import Browser - >>> browser = Browser() + >>> from plone.testing.z2 import Browser + >>> browser = Browser(app) >>> portal_url = 'http://nohost' >>> browser.handleErrors = False @@ -25,6 +25,7 @@ error:: We need to log in as a manager, because by default only managers get the 'Manage Schemata' permission:: >>> user = self.app.acl_users.userFolderAddUser('root', 'secret', ['Manager'], []) + >>> import transaction; transaction.commit() >>> browser.addHeader('Authorization', 'Basic root:secret') Now we should be able to navigate to the IDummySchema schema in the browser:: diff --git a/plone/schemaeditor/tests/extending.rst b/plone/schemaeditor/tests/extending.rst index 20c34d8..a9f1825 100644 --- a/plone/schemaeditor/tests/extending.rst +++ b/plone/schemaeditor/tests/extending.rst @@ -57,10 +57,11 @@ we need an adapter that provides the IFieldColor interface:: Now we can bring up the edit form for one of the test fields, and it should have the additional 'color' setting:: - >>> from Testing.testbrowser import Browser - >>> browser = Browser() + >>> from plone.testing.z2 import Browser + >>> browser = Browser(app) >>> browser.handleErrors = False >>> user = self.app.acl_users.userFolderAddUser('root', 'secret', ['Manager'], []) + >>> import transaction; transaction.commit() >>> browser.addHeader('Authorization', 'Basic root:secret') >>> browser.open('http://nohost/@@schemaeditor/field1') diff --git a/plone/schemaeditor/tests/minmax.rst b/plone/schemaeditor/tests/minmax.rst index a060017..2901d61 100644 --- a/plone/schemaeditor/tests/minmax.rst +++ b/plone/schemaeditor/tests/minmax.rst @@ -13,8 +13,9 @@ schema editor. >>> user = app.acl_users.userFolderAddUser( ... 'root', 'secret', ['Manager'], []) - >>> from Testing import testbrowser - >>> browser = testbrowser.Browser() + >>> import transaction; transaction.commit() + >>> from plone.testing.z2 import Browser + >>> browser = Browser(app) >>> browser.handleErrors = False >>> browser.addHeader('Authorization', 'Basic root:secret')