[CMF-checkins] SVN: CMF/branches/2.1/ Merged trunk r80862 unto 2.1 branch.

Stefan H. Holek stefan at epy.co.at
Sat Oct 13 12:02:34 EDT 2007


Log message for revision 80863:
  Merged trunk r80862 unto 2.1 branch.
  
  Prepare tests for upcoming ZopeLite layer.
  

Changed:
  U   CMF/branches/2.1/CHANGES.txt
  U   CMF/branches/2.1/CMFCore/testing.py
  U   CMF/branches/2.1/CMFCore/tests/base/testcase.py
  U   CMF/branches/2.1/DCWorkflow/testing.py

-=-
Modified: CMF/branches/2.1/CHANGES.txt
===================================================================
--- CMF/branches/2.1/CHANGES.txt	2007-10-13 15:59:36 UTC (rev 80862)
+++ CMF/branches/2.1/CHANGES.txt	2007-10-13 16:02:33 UTC (rev 80863)
@@ -20,7 +20,11 @@
       as StateChangeInfo passes on the new status to after-transition scripts.
       (http://www.zope.org/Collectors/CMF/490)
 
+  Other
 
+    - Testing: Derive test layers from ZopeLite layer if available.
+
+
 CMF 2.1.0 (2007/08/08)
 
   New Features

Modified: CMF/branches/2.1/CMFCore/testing.py
===================================================================
--- CMF/branches/2.1/CMFCore/testing.py	2007-10-13 15:59:36 UTC (rev 80862)
+++ CMF/branches/2.1/CMFCore/testing.py	2007-10-13 16:02:33 UTC (rev 80863)
@@ -231,6 +231,19 @@
         cleanUp()
 
 
+# Derive from ZopeLite layer if available
+try:
+    from Testing.ZopeTestCase.layer import ZopeLite
+except ImportError:
+    pass # Zope < 2.11
+else:
+    EventZCMLLayer.__bases__ = (ZopeLite,)
+    TraversingZCMLLayer.__bases__ = (ZopeLite,)
+    TraversingEventZCMLLayer.__bases__ = (ZopeLite,)
+    FunctionalZCMLLayer.__bases__ = (ZopeLite,)
+    ExportImportZCMLLayer.__bases__ = (ZopeLite,)
+
+
 def run(test_suite):
     options = testrunner.get_options()
     options.resume_layer = None

Modified: CMF/branches/2.1/CMFCore/tests/base/testcase.py
===================================================================
--- CMF/branches/2.1/CMFCore/tests/base/testcase.py	2007-10-13 15:59:36 UTC (rev 80862)
+++ CMF/branches/2.1/CMFCore/tests/base/testcase.py	2007-10-13 16:02:33 UTC (rev 80863)
@@ -80,6 +80,13 @@
 
 class TransactionalTest(unittest.TestCase):
 
+    try:
+        from Testing.ZopeTestCase.layer import ZopeLite
+    except ImportError:
+        pass # Zope < 2.11
+    else:
+        layer = ZopeLite
+
     def setUp(self):
         transaction.begin()
         self.app = self.root = ZopeTestCase.app()

Modified: CMF/branches/2.1/DCWorkflow/testing.py
===================================================================
--- CMF/branches/2.1/DCWorkflow/testing.py	2007-10-13 15:59:36 UTC (rev 80862)
+++ CMF/branches/2.1/DCWorkflow/testing.py	2007-10-13 16:02:33 UTC (rev 80863)
@@ -43,3 +43,13 @@
     @classmethod
     def tearDown(cls):
         cleanUp()
+
+
+# Derive from ZopeLite layer if available
+try:
+    from Testing.ZopeTestCase.layer import ZopeLite
+except ImportError:
+    pass # Zope < 2.11
+else:
+    ExportImportZCMLLayer.__bases__ = (ZopeLite,)
+



More information about the CMF-checkins mailing list