Mercurial > p > roundup > code
comparison test/test_dates.py @ 4407:f6a2bfd351ee
force tests checking text output to work in the "C" locale
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 09 Aug 2010 04:43:50 +0000 |
| parents | d5e2767d4e91 |
| children | 6e3e4f24c753 |
comparison
equal
deleted
inserted
replaced
| 4406:3a0395583de5 | 4407:f6a2bfd351ee |
|---|---|
| 21 import unittest | 21 import unittest |
| 22 import time | 22 import time |
| 23 import datetime | 23 import datetime |
| 24 import calendar | 24 import calendar |
| 25 | 25 |
| 26 from roundup import date, i18n | |
| 26 from roundup.date import Date, Interval, Range, fixTimeOverflow, \ | 27 from roundup.date import Date, Interval, Range, fixTimeOverflow, \ |
| 27 get_timezone | 28 get_timezone |
| 28 | 29 |
| 29 | 30 |
| 30 class DateTestCase(unittest.TestCase): | 31 class DateTestCase(unittest.TestCase): |
| 32 def setUp(self): | |
| 33 self.old_gettext_ = i18n.gettext | |
| 34 self.old_ngettext_ = i18n.ngettext | |
| 35 i18n.gettext = i18n.get_translation(language='C').gettext | |
| 36 i18n.ngettext = i18n.get_translation(language='C').ngettext | |
| 37 | |
| 38 def tearDown(self): | |
| 39 i18n.gettext = self.old_gettext_ | |
| 40 i18n.ngettext = self.old_ngettext_ | |
| 31 | 41 |
| 32 def testDateInterval(self): | 42 def testDateInterval(self): |
| 33 ae = self.assertEqual | 43 ae = self.assertEqual |
| 34 date = Date("2000-06-26.00:34:02 + 2d") | 44 date = Date("2000-06-26.00:34:02 + 2d") |
| 35 ae(str(date), '2000-06-28.00:34:02') | 45 ae(str(date), '2000-06-28.00:34:02') |
