Mercurial > babel > old > mirror
comparison 0.9.x/babel/tests/dates.py @ 399:26733b2c995d stable
Ported [436] to 0.9.x branch.
author | cmlenz |
---|---|
date | Tue, 15 Jul 2008 16:48:02 +0000 |
parents | 6a0e7205790f |
children | 3a00f8293d47 |
comparison
equal
deleted
inserted
replaced
391:e69a068990f0 | 399:26733b2c995d |
---|---|
20 from babel import dates | 20 from babel import dates |
21 | 21 |
22 | 22 |
23 class DateTimeFormatTestCase(unittest.TestCase): | 23 class DateTimeFormatTestCase(unittest.TestCase): |
24 | 24 |
25 def test_quarter_format(self): | |
26 d = date(2006, 6, 8) | |
27 fmt = dates.DateTimeFormat(d, locale='en_US') | |
28 self.assertEqual('2', fmt['Q']) | |
29 self.assertEqual('2nd quarter', fmt['QQQQ']) | |
30 d = date(2006, 12, 31) | |
31 fmt = dates.DateTimeFormat(d, locale='en_US') | |
32 self.assertEqual('Q4', fmt['QQQ']) | |
33 | |
25 def test_month_context(self): | 34 def test_month_context(self): |
26 d = date(2006, 1, 8) | 35 d = date(2006, 1, 8) |
27 fmt = dates.DateTimeFormat(d, locale='cs_CZ') | 36 fmt = dates.DateTimeFormat(d, locale='cs_CZ') |
28 self.assertEqual('1', fmt['MMM']) | 37 self.assertEqual('1', fmt['MMM']) |
29 fmt = dates.DateTimeFormat(d, locale='cs_CZ') | 38 fmt = dates.DateTimeFormat(d, locale='cs_CZ') |