[Zope-Checkins] CVS: Packages/DateTime/tests - testDateTime.py:1.21.12.5.10.1

Lennart Regebro regebro at nuxeo.com
Mon Nov 8 13:43:33 EST 2004


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

Modified Files:
      Tag: regebro-strftime_1127-branch
	testDateTime.py 
Log Message:
Collector #1127 fixed: strftime returned the incorrect time if the timezone was not the same as the local timezone.


=== Packages/DateTime/tests/testDateTime.py 1.21.12.5 => 1.21.12.5.10.1 ===
--- Packages/DateTime/tests/testDateTime.py:1.21.12.5	Mon Aug  2 05:49:18 2004
+++ Packages/DateTime/tests/testDateTime.py	Mon Nov  8 13:43:32 2004
@@ -7,6 +7,7 @@
 import time
 import unittest
 
+from DateTime.DateTime import _findLocalTimeZoneName
 from DateTime import DateTime
 
 try:
@@ -345,6 +346,16 @@
             self.fail('Zope Collector issue #484 (negative time bug): '
                       'TimeError raised')
 
+    def testStrftimeTZhandling(self):
+        '''strftime timezone testing'''
+        # This is a test for collector issue #1127
+        format = '%Y-%m-%d %H:%M %Z'
+        dt = DateTime('Wed, 19 Nov 2003 18:32:07 -0215')
+        dt_string = dt.strftime(format)
+        dt_local = dt.toZone(_findLocalTimeZoneName(0))
+        dt_localstring = dt_local.strftime(format)
+        self.assertEqual(dt_string, dt_localstring)
+                      
 
 def test_suite():
     return unittest.makeSuite(DateTimeTests)



More information about the Zope-Checkins mailing list