[CMF-checkins] SVN: CMF/branches/2.0/CMF - refactored test setup for traversing (fixes some broken tests on Zope trunk)

Yvo Schubbe y.2006_ at wcm-solutions.de
Tue May 23 05:18:07 EDT 2006


Log message for revision 68251:
  - refactored test setup for traversing (fixes some broken tests on Zope trunk)

Changed:
  U   CMF/branches/2.0/CMFCore/tests/base/testcase.py
  U   CMF/branches/2.0/CMFCore/tests/test_ActionInformation.py
  U   CMF/branches/2.0/CMFCore/tests/test_CachingPolicyManager.py
  U   CMF/branches/2.0/CMFCore/tests/test_TypesTool.py
  U   CMF/branches/2.0/CMFDefault/tests/test_DiscussionReply.py
  U   CMF/branches/2.0/CMFDefault/tests/test_Image.py
  U   CMF/branches/2.0/CMFDefault/tests/test_Portal.py

-=-
Modified: CMF/branches/2.0/CMFCore/tests/base/testcase.py
===================================================================
--- CMF/branches/2.0/CMFCore/tests/base/testcase.py	2006-05-23 08:53:54 UTC (rev 68250)
+++ CMF/branches/2.0/CMFCore/tests/base/testcase.py	2006-05-23 09:18:05 UTC (rev 68251)
@@ -15,6 +15,7 @@
 from AccessControl.SecurityManagement import newSecurityManager
 from AccessControl.SecurityManagement import noSecurityManager
 from AccessControl.SecurityManager import setSecurityPolicy
+from Products.Five import zcml
 from Testing.makerequest import makerequest
 
 from dummy import DummyFolder
@@ -43,7 +44,17 @@
 </configure>
 """
 
+def setUpTraversing():
+    import Products.Five
+    zcml.load_config('meta.zcml', Products.Five)
+    try:
+        # BBB: for Zope 2.9
+        from Products.Five.traversable import FiveTraversable
+        zcml.load_string(_TRAVERSE_ZCML)
+    except ImportError:
+        zcml.load_config('traversing.zcml', Products.Five)
 
+
 class LogInterceptor:
 
     logged = None

Modified: CMF/branches/2.0/CMFCore/tests/test_ActionInformation.py
===================================================================
--- CMF/branches/2.0/CMFCore/tests/test_ActionInformation.py	2006-05-23 08:53:54 UTC (rev 68250)
+++ CMF/branches/2.0/CMFCore/tests/test_ActionInformation.py	2006-05-23 09:18:05 UTC (rev 68251)
@@ -29,8 +29,8 @@
 from Products.CMFCore.tests.base.dummy import DummyContent
 from Products.CMFCore.tests.base.dummy import DummySite
 from Products.CMFCore.tests.base.dummy import DummyTool as DummyMembershipTool
-from Products.CMFCore.tests.base.testcase import _TRAVERSE_ZCML
 from Products.CMFCore.tests.base.testcase import SecurityTest
+from Products.CMFCore.tests.base.testcase import setUpTraversing
 from Products.CMFCore.tests.base.testcase import TransactionalTest
 
 
@@ -294,10 +294,9 @@
     def setUp(self):
         import Products.CMFCore
         TransactionalTest.setUp(self)
-        zcml.load_config('meta.zcml', Products.Five)
+        setUpTraversing()
         zcml.load_config('permissions.zcml', Products.Five)
         zcml.load_config('configure.zcml', Products.CMFCore)
-        zcml.load_string(_TRAVERSE_ZCML)
 
         root = self.root
         root._setObject('portal', DummyContent('portal', 'url_portal'))

Modified: CMF/branches/2.0/CMFCore/tests/test_CachingPolicyManager.py
===================================================================
--- CMF/branches/2.0/CMFCore/tests/test_CachingPolicyManager.py	2006-05-23 08:53:54 UTC (rev 68250)
+++ CMF/branches/2.0/CMFCore/tests/test_CachingPolicyManager.py	2006-05-23 09:18:05 UTC (rev 68251)
@@ -33,9 +33,9 @@
 from Products.CMFCore.tests.base.dummy import DummySite
 from Products.CMFCore.tests.base.dummy import DummyTool
 from Products.CMFCore.tests.base.dummy import DummyUserFolder
-from Products.CMFCore.tests.base.testcase import _TRAVERSE_ZCML
 from Products.CMFCore.tests.base.testcase import FSDVTest
 from Products.CMFCore.tests.base.testcase import RequestTest
+from Products.CMFCore.tests.base.testcase import setUpTraversing
 
 ACCLARK = DateTime( '2001/01/01' )
 portal_owner = 'portal_owner'
@@ -609,10 +609,9 @@
 
         RequestTest.setUp(self)
         FSDVTest.setUp(self)
-        zcml.load_config('meta.zcml', Products.Five)
+        setUpTraversing()
         zcml.load_config('permissions.zcml', Products.Five)
         zcml.load_config('configure.zcml', Products.CMFCore)
-        zcml.load_string(_TRAVERSE_ZCML)
 
         now = DateTime()
 

Modified: CMF/branches/2.0/CMFCore/tests/test_TypesTool.py
===================================================================
--- CMF/branches/2.0/CMFCore/tests/test_TypesTool.py	2006-05-23 08:53:54 UTC (rev 68250)
+++ CMF/branches/2.0/CMFCore/tests/test_TypesTool.py	2006-05-23 09:18:05 UTC (rev 68251)
@@ -39,8 +39,8 @@
 from Products.CMFCore.tests.base.dummy import DummyUserFolder
 from Products.CMFCore.tests.base.security import OmnipotentUser
 from Products.CMFCore.tests.base.security import UserWithRoles
-from Products.CMFCore.tests.base.testcase import _TRAVERSE_ZCML
 from Products.CMFCore.tests.base.testcase import SecurityTest
+from Products.CMFCore.tests.base.testcase import setUpTraversing
 from Products.CMFCore.tests.base.testcase import WarningInterceptor
 from Products.CMFCore.tests.base.tidata import FTIDATA_ACTIONS
 from Products.CMFCore.tests.base.tidata import FTIDATA_CMF15
@@ -59,11 +59,10 @@
         from Products.CMFCore.TypesTool import FactoryTypeInformation as FTI
 
         SecurityTest.setUp(self)
-        zcml.load_config('meta.zcml', Products.Five)
+        setUpTraversing()
         zcml.load_config('permissions.zcml', Products.Five)
         zcml.load_config('configure.zcml', Products.Five.browser)
         zcml.load_config('configure.zcml', Products.CMFCore)
-        zcml.load_string(_TRAVERSE_ZCML)
 
         self.site = DummySite('site').__of__(self.root)
         self.acl_users = self.site._setObject( 'acl_users', DummyUserFolder() )

Modified: CMF/branches/2.0/CMFDefault/tests/test_DiscussionReply.py
===================================================================
--- CMF/branches/2.0/CMFDefault/tests/test_DiscussionReply.py	2006-05-23 08:53:54 UTC (rev 68250)
+++ CMF/branches/2.0/CMFDefault/tests/test_DiscussionReply.py	2006-05-23 09:18:05 UTC (rev 68251)
@@ -24,20 +24,19 @@
 from Products.Five import zcml
 from zope.testing.cleanup import cleanUp
 
-from Products.CMFCore.tests.base.testcase import _TRAVERSE_ZCML
 from Products.CMFCore.tests.base.testcase import RequestTest
+from Products.CMFCore.tests.base.testcase import setUpTraversing
 
 
 class DiscussionReplyTest(RequestTest):
 
     def setUp(self):
         RequestTest.setUp(self)
-        zcml.load_config('meta.zcml', Products.Five)
+        setUpTraversing()
         zcml.load_config('permissions.zcml', Products.Five)
         zcml.load_config('configure.zcml', Products.GenericSetup)
         zcml.load_config('configure.zcml', Products.CMFCore)
         zcml.load_config('configure.zcml', Products.DCWorkflow)
-        zcml.load_string(_TRAVERSE_ZCML)
         try:
             factory = self.root.manage_addProduct['CMFDefault'].addConfiguredSite
             factory('cmf', 'CMFDefault:default', snapshot=False)

Modified: CMF/branches/2.0/CMFDefault/tests/test_Image.py
===================================================================
--- CMF/branches/2.0/CMFDefault/tests/test_Image.py	2006-05-23 08:53:54 UTC (rev 68250)
+++ CMF/branches/2.0/CMFDefault/tests/test_Image.py	2006-05-23 09:18:05 UTC (rev 68251)
@@ -31,8 +31,8 @@
 
 from Products.CMFCore.tests.base.dummy import DummySite
 from Products.CMFCore.tests.base.dummy import DummyTool
-from Products.CMFCore.tests.base.testcase import _TRAVERSE_ZCML
 from Products.CMFCore.tests.base.testcase import RequestTest
+from Products.CMFCore.tests.base.testcase import setUpTraversing
 from Products.CMFDefault import tests
 
 from common import ConformsToContent
@@ -109,12 +109,11 @@
 
     def setUp(self):
         RequestTest.setUp(self)
-        zcml.load_config('meta.zcml', Products.Five)
+        setUpTraversing()
         zcml.load_config('permissions.zcml', Products.Five)
         zcml.load_config('configure.zcml', Products.GenericSetup)
         zcml.load_config('configure.zcml', Products.CMFCore)
         zcml.load_config('configure.zcml', Products.DCWorkflow)
-        zcml.load_string(_TRAVERSE_ZCML)
         try:
             newSecurityManager(None, UnrestrictedUser('manager', '', ['Manager'], []))
             factory = self.root.manage_addProduct['CMFDefault'].addConfiguredSite

Modified: CMF/branches/2.0/CMFDefault/tests/test_Portal.py
===================================================================
--- CMF/branches/2.0/CMFDefault/tests/test_Portal.py	2006-05-23 08:53:54 UTC (rev 68250)
+++ CMF/branches/2.0/CMFDefault/tests/test_Portal.py	2006-05-23 09:18:05 UTC (rev 68251)
@@ -23,8 +23,8 @@
 from Products.Five import zcml
 from zope.testing.cleanup import cleanUp
 
-from Products.CMFCore.tests.base.testcase import _TRAVERSE_ZCML
 from Products.CMFCore.tests.base.testcase import SecurityRequestTest
+from Products.CMFCore.tests.base.testcase import setUpTraversing
 
 
 class CMFSiteTests(SecurityRequestTest):
@@ -48,12 +48,11 @@
 
     def setUp(self):
         SecurityRequestTest.setUp(self)
-        zcml.load_config('meta.zcml', Products.Five)
+        setUpTraversing()
         zcml.load_config('permissions.zcml', Products.Five)
         zcml.load_config('configure.zcml', Products.GenericSetup)
         zcml.load_config('configure.zcml', Products.CMFCore)
         zcml.load_config('configure.zcml', Products.DCWorkflow)
-        zcml.load_string(_TRAVERSE_ZCML)
 
     def tearDown(self):
         SecurityRequestTest.tearDown(self)



More information about the CMF-checkins mailing list