Skip to content

Commit

Permalink
Fixed tests when run with zope.component 5+.
Browse files Browse the repository at this point in the history
  • Loading branch information
mauritsvanrees committed Mar 16, 2022
1 parent 5f5ea1f commit 3061816
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Products/CMFPlone/tests/testSecurity.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ def get_admin_browser(self):
return browser

def test_plonetool(self):
base_url = self.layer["portal"].absolute_url() + "/plone_utils"
portal_url = self.layer["portal"].absolute_url()
base_url = portal_url + "/plone_utils"
browser = self.get_admin_browser()
method_names = (
"addPortalMessage",
Expand All @@ -173,6 +174,9 @@ def test_plonetool(self):
"normalizeString",
"getEmptyTitle",
)
# First open a url that actually works.
# This avoids an error with zope.component 5+.
browser.open(portal_url)
for method_name in method_names:
with self.assertRaises(NotFound):
browser.open(base_url + "/" + method_name)
Expand Down Expand Up @@ -226,6 +230,9 @@ def test_hotfix_20160419(self):
"propertyLabel",
"propertyDescription",
)
# First open a url that actually works.
# This avoids an error with zope.component 5+.
browser.open(portal_url)
for method_name in method_names:
with self.assertRaises(NotFound):
browser.open(portal_url + "/" + method_name)
Expand Down
2 changes: 2 additions & 0 deletions news/500.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fixed tests when run with ``zope.component`` 5+.
[maurits]

0 comments on commit 3061816

Please sign in to comment.