Skip to content

Commit 9d69c8f

Browse files
committed
[soc2010/test-refactor] Updated field_defaults to use unittest2 delta arg for assertAlmostEqual
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2010/test-refactor@13415 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent dfd3da2 commit 9d69c8f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tests/modeltests/field_defaults/tests.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# coding: utf-8
2-
from datetime import datetime
2+
from datetime import datetime, timedelta
33

44
from django.test import TestCase
55
from django.utils.safestring import SafeUnicode, SafeString
@@ -29,9 +29,7 @@ def test_article_defaults(self):
2929
self.assertEqual(a.headline, u'Default headline')
3030

3131
# make sure the two dates are sufficiently close
32-
#fixme, use the new unittest2 function
33-
d = now - a.pub_date
34-
self.assertTrue(d.seconds < 5)
32+
self.assertAlmostEqual(now, a.pub_date, delta=timedelta(5))
3533

3634
# make sure that SafeString/SafeUnicode fields work
3735
a.headline = SafeUnicode(u'Iñtërnâtiônàlizætiøn1')

0 commit comments

Comments
 (0)