[Checkins] SVN: GenericSetup/trunk/tests/common.py - set up
traversing for Zope 2.10
Yvo Schubbe
y.2006_ at wcm-solutions.de
Tue May 30 04:55:51 EDT 2006
Log message for revision 68391:
- set up traversing for Zope 2.10
Changed:
U GenericSetup/trunk/tests/common.py
-=-
Modified: GenericSetup/trunk/tests/common.py
===================================================================
--- GenericSetup/trunk/tests/common.py 2006-05-30 08:11:11 UTC (rev 68390)
+++ GenericSetup/trunk/tests/common.py 2006-05-30 08:55:49 UTC (rev 68391)
@@ -22,7 +22,9 @@
from Acquisition import Implicit
from Testing.ZopeTestCase import ZopeTestCase
from zope.interface import implements
+from zope.testing.cleanup import cleanUp
+from Products.Five import zcml
from Products.GenericSetup.interfaces import IExportContext
from Products.GenericSetup.interfaces import IImportContext
from Products.GenericSetup.testing import DummyLogger
@@ -45,10 +47,19 @@
def getRolesInContext(self, object):
return ('Manager',)
+
class SecurityRequestTest(ZopeTestCase):
+
def setUp(self):
+ import Products
from AccessControl.SecurityManagement import newSecurityManager
ZopeTestCase.setUp(self)
+ try:
+ # BBB: for Zope 2.9
+ from Products.Five.traversable import FiveTraversable
+ except ImportError:
+ zcml.load_config('meta.zcml', Products.Five)
+ zcml.load_config('traversing.zcml', Products.Five)
self.root = self.app
newSecurityManager(None, OmnipotentUser().__of__(self.app.acl_users))
@@ -56,7 +67,9 @@
from AccessControl.SecurityManagement import noSecurityManager
noSecurityManager()
ZopeTestCase.tearDown(self)
+ cleanUp()
+
class DOMComparator:
def _compareDOM( self, found_text, expected_text, debug=False ):
@@ -92,6 +105,7 @@
self.assertEqual( found.toxml(), expected.toxml() )
+
class BaseRegistryTests( SecurityRequestTest, DOMComparator ):
def _makeOne( self, *args, **kw ):
@@ -99,6 +113,7 @@
# Derived classes must implement _getTargetClass
return self._getTargetClass()( *args, **kw )
+
def _clearTestDirectory( root_path ):
if os.path.exists( root_path ):
@@ -120,6 +135,7 @@
file.close()
return fqpath
+
class FilesystemTestBase( SecurityRequestTest ):
def _makeOne( self, *args, **kw ):
More information about the Checkins
mailing list