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

Yvo Schubbe y.2005- at wcm-solutions.de
Mon Jun 13 13:32:35 EDT 2005


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

Modified Files:
	test_Event.py 
Log Message:
ported newstyle (Zope 3) interfaces from CMFonFive:
- 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.13 ===
--- Products/CMFCalendar/tests/test_Event.py:1.12	Thu Aug 12 11:07:38 2004
+++ Products/CMFCalendar/tests/test_Event.py	Mon Jun 13 13:32:04 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