[CMF-checkins] CVS: Products/CMFCalendar/tests - test_Event.py:1.12.2.1

Yvo Schubbe y.2005- at wcm-solutions.de
Wed Jun 15 06:14:59 EDT 2005


Update of /cvs-repository/Products/CMFCalendar/tests
In directory cvs.zope.org:/tmp/cvs-serv23808/CMFCalendar/tests

Modified Files:
      Tag: CMF-1_5-branch
	test_Event.py 
Log Message:
backported newstyle (Zope 3) interfaces from HEAD:
- added ZCML-files that bridge z2 to z3 interfaces
- added conformance tests
- fixed the Criterion interface
- added missing license headers
- cleaned up related tests a bit


=== Products/CMFCalendar/tests/test_Event.py 1.12 => 1.12.2.1 ===
--- Products/CMFCalendar/tests/test_Event.py:1.12	Thu Aug 12 11:07:38 2004
+++ Products/CMFCalendar/tests/test_Event.py	Wed Jun 15 06:14:29 2005
@@ -19,11 +19,9 @@
 import Testing
 import Zope
 Zope.startup()
-from Interface.Verify import verifyClass
 
 from DateTime import DateTime
 
-from Products.CMFCore.tests.base.dummy import DummySite
 from Products.CMFCore.tests.base.dummy import DummyTool
 from Products.CMFCore.tests.base.testcase import RequestTest
 
@@ -35,6 +33,45 @@
 
         return Event(id, *args, **kw)
 
+    def test_z2interfaces(self):
+        from Interface.Verify import verifyClass
+        from Products.CMFCore.interfaces.Contentish \
+                import Contentish as IContentish
+        from Products.CMFCore.interfaces.DublinCore \
+                import CatalogableDublinCore as ICatalogableDublinCore
+        from Products.CMFCore.interfaces.DublinCore \
+                import DublinCore as IDublinCore
+        from Products.CMFCore.interfaces.DublinCore \
+                import MutableDublinCore as IMutableDublinCore
+        from Products.CMFCore.interfaces.Dynamic \
+                import DynamicType as IDynamicType
+        from Products.CMFCalendar.Event import Event
+
+        verifyClass(ICatalogableDublinCore, Event)
+        verifyClass(IContentish, Event)
+        verifyClass(IDublinCore, Event)
+        verifyClass(IDynamicType, Event)
+        verifyClass(IMutableDublinCore, Event)
+
+    def test_z3interfaces(self):
+        try:
+            from zope.interface.verify import verifyClass
+        except ImportError:
+            # BBB: for Zope 2.7
+            return
+        from Products.CMFCalendar.Event import Event
+        from Products.CMFCore.interfaces import ICatalogableDublinCore
+        from Products.CMFCore.interfaces import IContentish
+        from Products.CMFCore.interfaces import IDublinCore
+        from Products.CMFCore.interfaces import IDynamicType
+        from Products.CMFCore.interfaces import IMutableDublinCore
+
+        verifyClass(ICatalogableDublinCore, Event)
+        verifyClass(IContentish, Event)
+        verifyClass(IDublinCore, Event)
+        verifyClass(IDynamicType, Event)
+        verifyClass(IMutableDublinCore, Event)
+
     def test_new(self):
         event = self._makeOne('test')
 
@@ -81,25 +118,6 @@
                          , startAMPM="AM"
                          )
 
-    def test_interface(self):
-        from Products.CMFCore.interfaces.Dynamic \
-                import DynamicType as IDynamicType
-        from Products.CMFCore.interfaces.Contentish \
-                import Contentish as IContentish
-        from Products.CMFCore.interfaces.DublinCore \
-                import DublinCore as IDublinCore
-        from Products.CMFCore.interfaces.DublinCore \
-                import CatalogableDublinCore as ICatalogableDublinCore
-        from Products.CMFCore.interfaces.DublinCore \
-                import MutableDublinCore as IMutableDublinCore
-        from Products.CMFCalendar.Event import Event
-
-        verifyClass(IDynamicType, Event)
-        verifyClass(IContentish, Event)
-        verifyClass(IDublinCore, Event)
-        verifyClass(ICatalogableDublinCore, Event)
-        verifyClass(IMutableDublinCore, Event)
-
 
 class EventPUTTests(RequestTest):
 
@@ -111,7 +129,7 @@
 
     def test_PutWithoutMetadata(self):
         self.REQUEST['BODY'] = ''
-        d = self._makeOne('foo') 
+        d = self._makeOne('foo')
         d.PUT(self.REQUEST, self.RESPONSE)
 
         self.assertEqual( d.Title(), '' )



More information about the CMF-checkins mailing list