Commit b95fabe5 authored by Arnaud Fontaine's avatar Arnaud Fontaine

ZODB Components: Restore original SecurityManager after running tests.

Tests may login/logout with different users. This fixes
testDynamicClassGeneration.TestZodbTestComponent.testRunLiveTest.
parent 0036c4ba
......@@ -237,4 +237,12 @@ def runLiveTest(test_list, verbosity=1, stream=None, **kw):
output = StringIO()
output.write("**Running Live Test:\n")
ZopeTestCase._print = output.write
result = TestRunner(stream=output, verbosity=verbosity).run(suite)
# Test may login/logout with different users, so ensure that at the end the
# original SecurityManager is restored
from AccessControl.SecurityManagement import getSecurityManager, setSecurityManager
sm = getSecurityManager()
try:
result = TestRunner(stream=output, verbosity=verbosity).run(suite)
finally:
setSecurityManager(sm)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment