Source

babel3 / babel / tests / dates.py

Diff from to

File babel/tests/dates.py

     def test_month_context(self):
         d = date(2006, 1, 8)
         fmt = dates.DateTimeFormat(d, locale='cs_CZ')
-        self.assertEqual('1', fmt['MMM'])
+        self.assertEqual('1', fmt['M'])
+        fmt = dates.DateTimeFormat(d, locale='cs_CZ')
+        self.assertEqual('01', fmt['MM'])
+        fmt = dates.DateTimeFormat(d, locale='cs_CZ')
+        self.assertEqual('Led', fmt['MMM'])
         fmt = dates.DateTimeFormat(d, locale='cs_CZ')
         self.assertEqual('1.', fmt['LLL'])
 
         fmt = dates.DateTimeFormat(d, locale='de_DE')
         self.assertEqual('52', fmt['w'])
         fmt = dates.DateTimeFormat(d, locale='en_US')
-        self.assertEqual('52', fmt['w'])
+        self.assertEqual('53', fmt['w'])
 
     def test_week_of_month_first(self):
         d = date(2006, 1, 8)
         self.assertEqual('7', fmt['e']) # monday is first day of week
         fmt = dates.DateTimeFormat(d, locale='en_US')
         self.assertEqual('01', fmt['ee']) # sunday is first day of week
-        fmt = dates.DateTimeFormat(d, locale='dv_MV')
+        fmt = dates.DateTimeFormat(d, locale='bn_BD')
         self.assertEqual('03', fmt['ee']) # friday is first day of week
 
         d = date(2007, 4, 2) # a monday
         self.assertEqual('1', fmt['e']) # monday is first day of week
         fmt = dates.DateTimeFormat(d, locale='en_US')
         self.assertEqual('02', fmt['ee']) # sunday is first day of week
-        fmt = dates.DateTimeFormat(d, locale='dv_MV')
+        fmt = dates.DateTimeFormat(d, locale='bn_BD')
         self.assertEqual('04', fmt['ee']) # friday is first day of week
 
     def test_local_day_of_week_standalone(self):
         self.assertEqual('7', fmt['c']) # monday is first day of week
         fmt = dates.DateTimeFormat(d, locale='en_US')
         self.assertEqual('1', fmt['c']) # sunday is first day of week
-        fmt = dates.DateTimeFormat(d, locale='dv_MV')
+        fmt = dates.DateTimeFormat(d, locale='bn_BD')
         self.assertEqual('3', fmt['c']) # friday is first day of week
 
         d = date(2007, 4, 2) # a monday
         self.assertEqual('1', fmt['c']) # monday is first day of week
         fmt = dates.DateTimeFormat(d, locale='en_US')
         self.assertEqual('2', fmt['c']) # sunday is first day of week
-        fmt = dates.DateTimeFormat(d, locale='dv_MV')
+        fmt = dates.DateTimeFormat(d, locale='bn_BD')
         self.assertEqual('4', fmt['c']) # friday is first day of week
 
     def test_fractional_seconds(self):
         tz = timezone('Europe/Paris')
         dt = datetime(2007, 4, 1, 15, 30, tzinfo=tz)
         fmt = dates.DateTimeFormat(dt, locale='fr_CA')
-        self.assertEqual('France', fmt['v'])
-
-    def test_timezone_with_uncommon(self):
-        tz = timezone('Europe/Paris')
-        dt = datetime(2007, 4, 1, 15, 30, tzinfo=tz)
-        fmt = dates.DateTimeFormat(dt, locale='fr_CA')
-        self.assertEqual('HEC', fmt['V'])
+        self.assertEqual('Heure\u00a0: France', fmt['v'])
 
     def test_timezone_location_format(self):
         tz = timezone('Europe/Paris')
         dt = datetime(2007, 4, 1, 15, 30, tzinfo=tz)
         fmt = dates.DateTimeFormat(dt, locale='fr_FR')
-        self.assertEqual('France', fmt['VVVV'])
+        self.assertEqual('Heure\u00a0: France', fmt['VVVV'])
 
     def test_timezone_walltime_short(self):
         tz = timezone('Europe/Paris')
         t = time(15, 30, tzinfo=tz)
-        fmt = dates.DateTimeFormat(t, locale='fr_FR')
-        self.assertEqual('HEC', fmt['v'])
+        fmt = dates.DateTimeFormat(t, locale='de_DE')
+        self.assertEqual('MEZ', fmt['v'])
 
     def test_timezone_walltime_long(self):
         tz = timezone('Europe/Paris')
         t = time(15, 30, tzinfo=tz)
         fmt = dates.DateTimeFormat(t, locale='fr_FR')
-        self.assertEqual('Heure de l\u2019Europe centrale', fmt['vvvv'])
+        self.assertEqual('heure de l\u2019Europe centrale', fmt['vvvv'])
 
     def test_hour_formatting(self):
         l = 'en_US'