summaryrefslogtreecommitdiff
path: root/tests/test_dates.py
diff options
context:
space:
mode:
authorAarni Koskela <akx@iki.fi>2017-08-18 13:14:46 +0300
committerAarni Koskela <akx@iki.fi>2018-01-17 09:18:50 +0200
commita43d46486746b270f44e5412fc227d5f803bdf9e (patch)
tree8c99e304afcc52fb0ca8f29bfd5e7033a4ab9bf6 /tests/test_dates.py
parent77849ec967f9ff6f8470753abc2976c94b22aa2e (diff)
downloadbabel-cldr-30.tar.gz
cldr: use CLDR 31.0.1 (and fix test changes); see below!cldr-30
CLDR 31.0 separated the GMT and UTC time zones, so formatting of that time zone has changed. Most notably, "UTC" replaces "+0000" when formatting the timezone. This could break code that expects +0000. A subset (the parts supported by Babel) of the migration guide from http://cldr.unicode.org/index/downloads/cldr-31: * The locales in the language-territory population tables have been changed to be the canonical format, dropping the script where it is the default. So "ku_Latn" changes to "ku". * Plural rules: The Portuguese plural rules have changed so that all (and only) integers and decimal fractions < 2 are singular. * Timezones: The GMT timezone has been split from the UTC timezone. * Timezones: New timezone bcp47 codes have been added. * Languages "hr" and "sr" are no longer a short distance apart, for political reasons. * The primary names for CZ changed from "Czech Republic" to "Czechia", with the longer name now the alternate.
Diffstat (limited to 'tests/test_dates.py')
-rw-r--r--tests/test_dates.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/test_dates.py b/tests/test_dates.py
index f74cd39..9a01d98 100644
--- a/tests/test_dates.py
+++ b/tests/test_dates.py
@@ -292,7 +292,7 @@ class FormatDatetimeTestCase(unittest.TestCase):
d = datetime(2012, 4, 1, 15, 30, 29, tzinfo=timezone('UTC'))
epoch = float(calendar.timegm(d.timetuple()))
formatted_string = dates.format_datetime(epoch, format='long', locale='en_US')
- self.assertEqual(u'April 1, 2012 at 3:30:29 PM +0000', formatted_string)
+ self.assertEqual(u'April 1, 2012 at 3:30:29 PM UTC', formatted_string)
def test_timezone_formats(self):
dt = datetime(2016, 1, 13, 7, 8, 35)
@@ -358,9 +358,9 @@ class FormatDatetimeTestCase(unittest.TestCase):
formatted_string = dates.format_datetime(dt, 'OOOO', locale='en')
self.assertEqual(u'GMT+00:00', formatted_string)
formatted_string = dates.format_datetime(dt, 'VV', locale='en')
- self.assertEqual(u'Etc/GMT', formatted_string)
+ self.assertEqual(u'Etc/UTC', formatted_string)
formatted_string = dates.format_datetime(dt, 'VVV', locale='en')
- self.assertEqual(u'GMT', formatted_string)
+ self.assertEqual(u'UTC', formatted_string)
formatted_string = dates.format_datetime(dt, 'X', locale='en')
self.assertEqual(u'Z', formatted_string)
formatted_string = dates.format_datetime(dt, 'XX', locale='en')
@@ -430,7 +430,7 @@ class FormatTimeTestCase(unittest.TestCase):
d = datetime(2012, 4, 1, 15, 30, 29, tzinfo=timezone('UTC'))
epoch = float(calendar.timegm(d.timetuple()))
formatted_time = dates.format_time(epoch, format='long', locale='en_US')
- self.assertEqual(u'3:30:29 PM +0000', formatted_time)
+ self.assertEqual(u'3:30:29 PM UTC', formatted_time)
def test_with_date_fields_in_pattern(self):
self.assertRaises(AttributeError, dates.format_time, date(2007, 4, 1),
@@ -511,7 +511,7 @@ class TimeZoneAdjustTestCase(unittest.TestCase):
utc = self._utc()
t = datetime(2007, 4, 1, 15, 30, tzinfo=utc)
formatted_time = dates.format_time(t, 'long', tzinfo=utc, locale='en')
- self.assertEqual('3:30:00 PM +0000', formatted_time)
+ self.assertEqual('3:30:00 PM UTC', formatted_time)
def test_get_period_names():
@@ -633,8 +633,8 @@ def test_get_timezone_name():
assert (dates.get_timezone_name('Europe/Berlin', locale='en_US') == "Central European Time")
- assert (dates.get_timezone_name(1400000000, locale='en_US', width='short') == "Unknown Region (GMT) Time")
- assert (dates.get_timezone_name(time(16, 20), locale='en_US', width='short') == "+0000")
+ assert (dates.get_timezone_name(1400000000, locale='en_US', width='short') == "Unknown Region (UTC) Time")
+ assert (dates.get_timezone_name(time(16, 20), locale='en_US', width='short') == "UTC")
def test_format_date():