diff options
author | Armin Ronacher <armin.ronacher@active-4.com> | 2015-07-27 13:22:31 +0200 |
---|---|---|
committer | Armin Ronacher <armin.ronacher@active-4.com> | 2015-07-27 13:22:31 +0200 |
commit | aa4165df073239a9f6ff01c0b5f6cb430a5b9d10 (patch) | |
tree | 014cb7fc980b9acc99badb36afbc180b4b52a44c /tests | |
parent | 246996b0ee51e49ebcd504e234d3bcdcb178996c (diff) | |
download | babel-aa4165df073239a9f6ff01c0b5f6cb430a5b9d10.tar.gz |
Fixed a bunch of broken timezone tests.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_dates.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/test_dates.py b/tests/test_dates.py index 7b897a1..2571929 100644 --- a/tests/test_dates.py +++ b/tests/test_dates.py @@ -177,19 +177,19 @@ class DateTimeFormatTestCase(unittest.TestCase): def test_timezone_rfc822(self): tz = timezone('Europe/Berlin') - t = time(15, 30, tzinfo=tz) + t = tz.localize(datetime(2015, 1, 1, 15, 30)) fmt = dates.DateTimeFormat(t, locale='de_DE') self.assertEqual('+0100', fmt['Z']) def test_timezone_gmt(self): tz = timezone('Europe/Berlin') - t = time(15, 30, tzinfo=tz) + t = tz.localize(datetime(2015, 1, 1, 15, 30)) fmt = dates.DateTimeFormat(t, locale='de_DE') self.assertEqual('GMT+01:00', fmt['ZZZZ']) def test_timezone_name(self): tz = timezone('Europe/Paris') - dt = datetime(2007, 4, 1, 15, 30, tzinfo=tz) + dt = tz.localize(datetime(2007, 4, 1, 15, 30)) fmt = dates.DateTimeFormat(dt, locale='fr_FR') self.assertEqual('Heure : France', fmt['v']) @@ -380,11 +380,11 @@ def test_get_timezone_gmt(): assert dates.get_timezone_gmt(dt, locale='en') == u'GMT+00:00' tz = timezone('America/Los_Angeles') - dt = datetime(2007, 4, 1, 15, 30, tzinfo=tz) - assert dates.get_timezone_gmt(dt, locale='en') == u'GMT-08:00' - assert dates.get_timezone_gmt(dt, 'short', locale='en') == u'-0800' + dt = tz.localize(datetime(2007, 4, 1, 15, 30)) + assert dates.get_timezone_gmt(dt, locale='en') == u'GMT-07:00' + assert dates.get_timezone_gmt(dt, 'short', locale='en') == u'-0700' - assert dates.get_timezone_gmt(dt, 'long', locale='fr_FR') == u'UTC-08:00' + assert dates.get_timezone_gmt(dt, 'long', locale='fr_FR') == u'UTC-07:00' def test_get_timezone_location(): |