Skip to content

Commit

Permalink
use plone.testing testbrowser
Browse files Browse the repository at this point in the history
  • Loading branch information
davisagli committed Feb 11, 2017
1 parent ddff4ed commit 9348074
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
-------------------
Expand Down
5 changes: 3 additions & 2 deletions plone/schemaeditor/tests/choice.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
5 changes: 3 additions & 2 deletions plone/schemaeditor/tests/editing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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::
Expand Down
5 changes: 3 additions & 2 deletions plone/schemaeditor/tests/extending.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
5 changes: 3 additions & 2 deletions plone/schemaeditor/tests/minmax.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down

1 comment on commit 9348074

@jenkins-plone-org
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davisagli Jenkins CI reporting about code analysis
See the full report here: http://jenkins.plone.org/job/package-plone.schemaeditor/24/violations

plone/schemaeditor/utils.py:73:12: P002 found "hasattr", consider replacing it
plone/schemaeditor/utils.py:84:16: P002 found "hasattr", consider replacing it
plone/schemaeditor/browser/field/edit.py:176:12: P002 found "hasattr", consider replacing it
plone/schemaeditor/browser/schema/listing.py:55:16: P002 found "hasattr", consider replacing it
plone/schemaeditor/tests/tests.py:14:1: I003 isort expected 1 blank line in imports, found 0

Follow these instructions to reproduce it locally.

Please sign in to comment.