[Zope-CVS] CVS: Products/Ape/lib/apelib/tests - zope2testbase.py:1.5

Shane Hathaway shane at zope.com
Thu Aug 14 17:21:44 EDT 2003


Update of /cvs-repository/Products/Ape/lib/apelib/tests
In directory cvs.zope.org:/tmp/cvs-serv2659/lib/apelib/tests

Modified Files:
	zope2testbase.py 
Log Message:
Work around breakage in Zope 2.6's date_international type.

field2date_international() is not present in Zope 2.6, causing this test
to fail.


=== Products/Ape/lib/apelib/tests/zope2testbase.py 1.4 => 1.5 ===
--- Products/Ape/lib/apelib/tests/zope2testbase.py:1.4	Wed Jun 11 09:58:53 2003
+++ Products/Ape/lib/apelib/tests/zope2testbase.py	Thu Aug 14 16:21:39 2003
@@ -281,12 +281,17 @@
             app._setObject(f.id, f, set_owner=0)
             get_transaction().commit()
 
+            # International dates don't work in Zope 2.6.
+            from ZPublisher import Converters
+            INTL_DATES = hasattr(Converters, 'field2date_international')
+
             f._setProperty('string1', 's', 'string')
             f._setProperty('float1', 3.14, 'float')
             f._setProperty('int1', 5, 'int')
             f._setProperty('long1', 2L**33, 'long')
             f._setProperty('date1', now, 'date')
-            f._setProperty('date2', now, 'date_international')
+            if INTL_DATES:
+                f._setProperty('date2', now, 'date_international')
             f._setProperty('text1', 'abc\ndef', 'text')
             f._setProperty('boolean0', 0, 'boolean')
             f._setProperty('boolean1', 1, 'boolean')
@@ -302,7 +307,8 @@
                 self.assertEqual(f.int1, 5)
                 self.assertEqual(f.long1, 2L**33)
                 self.assertEqual(f.date1, now)
-                self.assertEqual(f.date2, now)
+                if INTL_DATES:
+                    self.assertEqual(f.date2, now)
                 self.assertEqual(f.text1, 'abc\ndef')
                 self.assertEqual(f.boolean0, 0)
                 self.assertEqual(f.boolean1, 1)




More information about the Zope-CVS mailing list