[Zope3-checkins] CVS: Zope3/src/datetime/tests - test_datetime.py:1.22

Tim Peters tim.one@comcast.net
Wed, 22 Jan 2003 15:52:05 -0500


Update of /cvs-repository/Zope3/src/datetime/tests
In directory cvs.zope.org:/tmp/cvs-serv27031/src/datetime/tests

Modified Files:
	test_datetime.py 
Log Message:
Ensure astimezone() calls user-defined fromutc() (if any).


=== Zope3/src/datetime/tests/test_datetime.py 1.21 => 1.22 ===
--- Zope3/src/datetime/tests/test_datetime.py:1.21	Wed Jan 22 15:44:00 2003
+++ Zope3/src/datetime/tests/test_datetime.py	Wed Jan 22 15:52:03 2003
@@ -2832,6 +2832,10 @@
             got = FEastern.fromutc(fstart)
             self.assertEqual(expected, got)
 
+            # Ensure astimezone() calls fromutc() too.
+            got = fstart.replace(tzinfo=utc_real).astimezone(FEastern)
+            self.assertEqual(expected, got)
+
             start += HOUR
             fstart += HOUR
 
@@ -2845,6 +2849,10 @@
 
             expected = fstart + FEastern.stdoffset
             got = FEastern.fromutc(fstart)
+            self.assertEqual(expected, got)
+
+            # Ensure astimezone() calls fromutc() too.
+            got = fstart.replace(tzinfo=utc_real).astimezone(FEastern)
             self.assertEqual(expected, got)
 
             start += HOUR