Author: PaulM
Date: 2010-07-02 13:06:24 -0500 (Fri, 02 Jul 2010)
New Revision: 13415

Modified:
   
django/branches/soc2010/test-refactor/tests/modeltests/field_defaults/tests.py
Log:
[soc2010/test-refactor] Updated field_defaults to use unittest2 delta arg for 
assertAlmostEqual


Modified: 
django/branches/soc2010/test-refactor/tests/modeltests/field_defaults/tests.py
===================================================================
--- 
django/branches/soc2010/test-refactor/tests/modeltests/field_defaults/tests.py  
    2010-07-02 17:53:09 UTC (rev 13414)
+++ 
django/branches/soc2010/test-refactor/tests/modeltests/field_defaults/tests.py  
    2010-07-02 18:06:24 UTC (rev 13415)
@@ -1,5 +1,5 @@
 # coding: utf-8
-from datetime import datetime
+from datetime import datetime, timedelta
 
 from django.test import TestCase
 from django.utils.safestring import SafeUnicode, SafeString
@@ -29,9 +29,7 @@
         self.assertEqual(a.headline, u'Default headline')
 
         # make sure the two dates are sufficiently close
-        #fixme, use the new unittest2 function
-        d = now - a.pub_date
-        self.assertTrue(d.seconds < 5)
+        self.assertAlmostEqual(now, a.pub_date, delta=timedelta(5))
 
         # make sure that SafeString/SafeUnicode fields work
         a.headline = SafeUnicode(u'Iñtërnâtiônàlizætiøn1')

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to