From c8a49cbc4bf8ab2c60dcedbe12ffc1c31ff6ce0f Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Sat, 30 Jul 2016 14:01:13 -0400 Subject: [PATCH] Fix ParseRfc822Date test so that it works in time zones other than Robin's --- unittests/test_wxdatetime.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/unittests/test_wxdatetime.py b/unittests/test_wxdatetime.py index 7579c897..4dc78ae6 100644 --- a/unittests/test_wxdatetime.py +++ b/unittests/test_wxdatetime.py @@ -192,9 +192,12 @@ class datetime_Tests(wtc.WidgetTestCase): def test_datetimeParseRfc822Date(self): d = wx.DateTime() - val = d.ParseRfc822Date('Wed, 25 Feb 2015 13:34:45 -0800') + rfc822str = 'Wed, 25 Feb 2015 13:34:45 -0800' + import email.utils as eu + st = time.localtime(eu.mktime_tz(eu.parsedate_tz(rfc822str))) + val = d.ParseRfc822Date(rfc822str) self.assertEqual(val, 31) - self.assertEqual(d.hour, 13) + self.assertEqual(d.hour, st.tm_hour) self.assertEqual(d.minute, 34)