diff options
Diffstat (limited to 'tests/test_html.py')
-rw-r--r-- | tests/test_html.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/tests/test_html.py b/tests/test_html.py index 6f0b294a..6f6f42e4 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -386,16 +386,13 @@ class HtmlTest(HtmlTestHelpers, CoverageTest): m = re.search(timestamp_pat, html) self.assertTrue(m, "Didn't find a timestamp!") timestamp = datetime.datetime(*map(int, m.groups())) - age = datetime.datetime.now() - timestamp - # Python2.6 doesn't have total_seconds :( - self.assertEqual(age.days, 0) # The timestamp only records the minute, so the delta could be from # 12:00 to 12:01:59, or two minutes. - self.assertLessEqual( - abs(age.seconds), - 120, - "Timestamp is wrong: {0}".format(timestamp) - ) + self.assert_recent_datetime( + timestamp, + seconds=120, + msg="Timestamp is wrong: {0}".format(timestamp), + ) class HtmlStaticFileTest(CoverageTest): |