[Zope-Checkins] SVN: Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/tests/test Make some tests run: provide default traversal adapter so that simple path

Philipp von Weitershausen philikon at philikon.de
Sun May 21 08:58:09 EDT 2006


Log message for revision 68209:
  Make some tests run: provide default traversal adapter so that simple path
  traversal works.
  

Changed:
  U   Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/tests/testDTMLTests.py
  U   Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/tests/testHTMLTests.py

-=-
Modified: Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/tests/testDTMLTests.py
===================================================================
--- Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/tests/testDTMLTests.py	2006-05-21 12:48:29 UTC (rev 68208)
+++ Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/tests/testDTMLTests.py	2006-05-21 12:58:08 UTC (rev 68209)
@@ -13,6 +13,8 @@
 
 import os, sys, unittest
 
+import zope.component.testing
+from zope.traversing.adapters import DefaultTraversable
 from Products.PageTemplates.tests import util
 from Products.PageTemplates.PageTemplate import PageTemplate
 from Acquisition import Implicit
@@ -43,16 +45,20 @@
     def checkPermission( self, permission, object, context) :
         return 1
 
-class DTMLTests(unittest.TestCase):
+class DTMLTests(zope.component.testing.PlacelessSetup, unittest.TestCase):
 
     def setUp(self):
-        self.t=(AqPageTemplate())
+        super(DTMLTests, self).setUp()
+        zope.component.provideAdapter(DefaultTraversable, (None,))
+
+        self.t = AqPageTemplate()
         self.policy = UnitTestSecurityPolicy()
-        self.oldPolicy = SecurityManager.setSecurityPolicy( self.policy )
+        self.oldPolicy = SecurityManager.setSecurityPolicy(self.policy)
         noSecurityManager()  # Use the new policy.
 
     def tearDown(self):
-        SecurityManager.setSecurityPolicy( self.oldPolicy )
+        super(DTMLTests, self).tearDown()
+        SecurityManager.setSecurityPolicy(self.oldPolicy)
         noSecurityManager()  # Reset to old policy.
 
     def check1(self):

Modified: Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/tests/testHTMLTests.py
===================================================================
--- Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/tests/testHTMLTests.py	2006-05-21 12:48:29 UTC (rev 68208)
+++ Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/tests/testHTMLTests.py	2006-05-21 12:58:08 UTC (rev 68209)
@@ -13,6 +13,8 @@
 
 import os, sys, unittest
 
+import zope.component.testing
+from zope.traversing.adapters import DefaultTraversable
 from Products.PageTemplates.tests import util
 from Products.PageTemplates.PageTemplate import PageTemplate
 from Products.PageTemplates.GlobalTranslationService import \
@@ -59,9 +61,12 @@
     def checkPermission( self, permission, object, context) :
         return 1
 
-class HTMLTests(unittest.TestCase):
+class HTMLTests(zope.component.testing.PlacelessSetup, unittest.TestCase):
 
     def setUp(self):
+        super(HTMLTests, self).setUp()
+        zope.component.provideAdapter(DefaultTraversable, (None,))
+
         self.folder = f = Folder()
         f.laf = AqPageTemplate()
         f.t = AqPageTemplate()
@@ -70,6 +75,7 @@
         noSecurityManager()  # Use the new policy.
 
     def tearDown(self):
+        super(HTMLTests, self).tearDown()
         SecurityManager.setSecurityPolicy( self.oldPolicy )
         noSecurityManager()  # Reset to old policy.
 



More information about the Zope-Checkins mailing list