Skip to content

Commit

Permalink
[soc2010/test-refactor] Updated field_defaults to use unittest2 delta…
Browse files Browse the repository at this point in the history
… arg for assertAlmostEqual

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2010/test-refactor@13415 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
PaulMcMillan committed Jul 2, 2010
1 parent dfd3da2 commit 9d69c8f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/modeltests/field_defaults/tests.py
@@ -1,5 +1,5 @@
# coding: utf-8 # coding: utf-8
from datetime import datetime from datetime import datetime, timedelta


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


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


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

0 comments on commit 9d69c8f

Please sign in to comment.