Ticket #19210: 19210_test.patch

File 19210_test.patch, 734 bytes (added by Hiroki Kiyohara, 12 years ago)

Added test to verifiy the behavior while long time.

  • tests/regressiontests/utils/timesince.py

    diff --git a/tests/regressiontests/utils/timesince.py b/tests/regressiontests/utils/timesince.py
    index 5e641a4..f338ad4e 100644
    a b class TimesinceTests(unittest.TestCase):  
    122122        self.assertEqual(timesince(future), '0 minutes')
    123123        past = datetime.datetime(1980, 1, 1, tzinfo=naive())
    124124        self.assertEqual(timeuntil(past), '0 minutes')
     125
     126    def test_thousand_years_ago(self):
     127        from dateutil.relativedelta import relativedelta
     128        now = datetime.datetime.now()
     129        thousand_years_ago = now - relativedelta(years=1000)
     130
     131        self.assertEqual(timesince(thousand_years_ago), '1000 years')
Back to Top