[Zope-Checkins] CVS: Zope/lib/python/DateTime/tests - testDateTime.py:1.19.4.1

Andreas Jung andreas@andreas-jung.com
Sat, 30 Nov 2002 03:37:06 -0500


Update of /cvs-repository/Zope/lib/python/DateTime/tests
In directory cvs.zope.org:/tmp/cvs-serv25677/tests

Modified Files:
      Tag: ajung-european-datetime-support-branch
	testDateTime.py 
Log Message:
added support for consistent parsing of international dates
with days before month before years


=== Zope/lib/python/DateTime/tests/testDateTime.py 1.19 => 1.19.4.1 ===
--- Zope/lib/python/DateTime/tests/testDateTime.py:1.19	Tue Oct 29 14:08:40 2002
+++ Zope/lib/python/DateTime/tests/testDateTime.py	Sat Nov 30 03:37:04 2002
@@ -276,6 +276,19 @@
         self.assertEqual(dts[5], "%+03d%02d" % divmod( (-offset/60), 60) )
 
 
+    def testInternationalDateformat(self):
+
+        for year in range(1990, 2020):
+            for month in range (1,13):
+                for day in range(1,32):
+                    try: d_us = DateTime("%d/%d/%d" % (year,month,day))
+                    except: continue
+
+                    d_int = DateTime("%d.%d.%d" % (day,month,year), datefmt="international")
+                    self.assertEqual(d_us, d_int)
+
+
+
 def test_suite():
     return unittest.makeSuite(DateTimeTests)