Skip to content

Commit

Permalink
Fix test failure due to renamed Australian timezone
Browse files Browse the repository at this point in the history
Australia/Sydney uses the AEST/AEDT (Australian Eastern
Standard/Daylight Time) abbreviations with pytz >= 2014.7.

We need a different country that still uses 'EST'.

(I hoped for one with a different UTC offset, but I can't seem to find one!)
  • Loading branch information
mgedmin committed Sep 3, 2014
1 parent 178df1b commit 04af837
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/zope/i18n/tests/test_formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,10 @@ def testParseTimeZoneNames(self):
self.assertEqual(dt.tzinfo.zone, 'US/Eastern')
self.assertEqual(dt.tzinfo.tzname(dt), 'EST')

dt = self.format.parse('01.01.2003 09:48 Australia/Sydney',
dt = self.format.parse('01.01.2003 09:48 Canada/Eastern',
'dd.MM.yyyy HH:mm zzzz')
self.assertEqual(dt.tzinfo.utcoffset(dt), datetime.timedelta(hours=11))
self.assertEqual(dt.tzinfo.zone, 'Australia/Sydney')
self.assertEqual(dt.tzinfo.utcoffset(dt), datetime.timedelta(hours=-5))
self.assertEqual(dt.tzinfo.zone, 'Canada/Eastern')
self.assertEqual(dt.tzinfo.tzname(dt), 'EST')

# Note that historical and future (as far as known)
Expand All @@ -340,7 +340,6 @@ def testParseTimeZoneNames(self):
self.assertEqual(dt.tzinfo.tzname(dt), 'EDT')
self.assertEqual(dt.tzinfo.utcoffset(dt), datetime.timedelta(hours=-4))


def testDateTimeParseError(self):
self.assertRaises(DateTimeParseError,
self.format.parse, '02.01.03 21:48', 'dd.MM.yyyy HH:mm')
Expand Down

0 comments on commit 04af837

Please sign in to comment.