Skip to content

Commit

Permalink
Fix testBindings to run in python3.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephan-hof committed Jun 8, 2017
1 parent cb0a645 commit 15f7b9f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Products/PythonScripts/tests/testBindings.py
Expand Up @@ -202,7 +202,10 @@ def test_bound_used_container(self):

ps = guarded._getOb('container_ps')
container = ps()
self.assertRaises(Unauthorized, container)

with self.assertRaises(Unauthorized):
container()

self.assertRaises(Unauthorized, container.index_html)
try:
str(container)
Expand Down Expand Up @@ -251,7 +254,12 @@ def test_bound_used_context(self):

ps = guarded._getOb('context_ps')
context = ps()
self.assertRaises(Unauthorized, context)

# Without using the contextmanager 'assertRaises' tries to access an
# attribute of context, which leads to an error right away.
with self.assertRaises(Unauthorized):
context()

self.assertRaises(Unauthorized, context.index_html)
try:
str(context)
Expand Down

0 comments on commit 15f7b9f

Please sign in to comment.