Commit cb7813ef authored by Jens Vagelpohl's avatar Jens Vagelpohl

Squashing unit tests failures occurring on Mac OS X.

The changes simply emulate the setup and teardown as done in the other
testing module for PageTemplates, testHTMLTests. I am not 100% sure if the fix
is the correct thing to do but it makes the tests run on Mac OS X and
does not affect them on Linux.

The main reason behind the failures is most likely some other test that runs
before which fiddles with the security policies but never cleans up
afterwards. I did some poking but could not find anything.
parent 6bc1f4b7
......@@ -17,6 +17,7 @@ from Products.PageTemplates.tests import util
from Products.PageTemplates.PageTemplate import PageTemplate
from Acquisition import Implicit
from AccessControl import SecurityManager
from AccessControl.SecurityManagement import noSecurityManager
class AqPageTemplate(Implicit, PageTemplate):
pass
......@@ -48,9 +49,11 @@ class DTMLTests(unittest.TestCase):
self.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 check1(self):
"""DTML test 1: if, in, and var:
......
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