[ZPT] CVS: Zope/lib/python/Products/PageTemplates/tests - testHTMLTests.py:1.12
Shane Hathaway
shane@cvs.zope.org
Fri, 11 Jan 2002 15:52:48 -0500
Update of /cvs-repository/Zope/lib/python/Products/PageTemplates/tests
In directory cvs.zope.org:/tmp/cvs-serv17291/tests
Modified Files:
testHTMLTests.py
Log Message:
Made sure the special security policy takes effect for this test.
=== Zope/lib/python/Products/PageTemplates/tests/testHTMLTests.py 1.11 => 1.12 ===
from Products.PageTemplates.PageTemplate import PageTemplate
from AccessControl import SecurityManager
+from AccessControl.SecurityManagement import noSecurityManager
from Acquisition import Implicit
class AqPageTemplate(Implicit, PageTemplate):
@@ -54,9 +55,11 @@
f.t = AqPageTemplate()
self.policy = UnitTestSecurityPolicy()
self.oldPolicy = SecurityManager.setSecurityPolicy( self.policy )
+ noSecurityManager() # Use the new policy.
def tearDown(self):
SecurityManager.setSecurityPolicy( self.oldPolicy )
+ noSecurityManager() # Reset to old policy.
def assert_expected(self, t, fname, *args, **kwargs):
t.write(util.read_input(fname))