summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_email
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_email')
-rw-r--r--Lib/test/test_email/test_utils.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/test/test_email/test_utils.py b/Lib/test/test_email/test_utils.py
index d9c4d70..7d0267e 100644
--- a/Lib/test/test_email/test_utils.py
+++ b/Lib/test/test_email/test_utils.py
@@ -87,17 +87,23 @@ class LocaltimeTests(unittest.TestCase):
t2 = utils.localtime(t1)
self.assertEqual(t1, t2)
+ @test.support.run_with_tz('EST+05EDT,M3.2.0,M11.1.0')
def test_localtime_epoch_utc_daylight_true(self):
test.support.patch(self, time, 'daylight', True)
t0 = datetime.datetime(1970, 1, 1, tzinfo = datetime.timezone.utc)
t1 = utils.localtime(t0)
- self.assertEqual(t0, t1)
+ t2 = t0 - datetime.timedelta(hours=5)
+ t2 = t2.replace(tzinfo = datetime.timezone(datetime.timedelta(hours=-5)))
+ self.assertEqual(t1, t2)
+ @test.support.run_with_tz('EST+05EDT,M3.2.0,M11.1.0')
def test_localtime_epoch_utc_daylight_false(self):
test.support.patch(self, time, 'daylight', False)
t0 = datetime.datetime(1970, 1, 1, tzinfo = datetime.timezone.utc)
t1 = utils.localtime(t0)
- self.assertEqual(t0, t1)
+ t2 = t0 - datetime.timedelta(hours=5)
+ t2 = t2.replace(tzinfo = datetime.timezone(datetime.timedelta(hours=-5)))
+ self.assertEqual(t1, t2)
def test_localtime_epoch_notz_daylight_true(self):
test.support.patch(self, time, 'daylight', True)