[Zope-Checkins] CVS: Packages/DateTime/tests -
testDateTime.py:1.21.12.6
Lennart Regebro
regebro at nuxeo.com
Mon Nov 8 13:50:44 EST 2004
Update of /cvs-repository/Packages/DateTime/tests
In directory cvs.zope.org:/tmp/cvs-serv11906/lib/python/DateTime/tests
Modified Files:
Tag: Zope-2_7-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.6 ===
--- 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:50:44 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