]> git.ozlabs.org Git - patchwork/commitdiff
test_notifications: Fix testNotificationUpdated timestamp comparison
authorDamien Lespiau <damien.lespiau@intel.com>
Sat, 8 Nov 2014 13:25:58 +0000 (13:25 +0000)
committerJeremy Kerr <jk@ozlabs.org>
Mon, 10 Nov 2014 12:27:28 +0000 (20:27 +0800)
With MySQL, the django ORM defaults to mapping DateTimeField to
Timestamp and this has only a precision of seconds.

Let's use >= here then, which doesn't affect the correctness of this
test.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
apps/patchwork/tests/test_notifications.py

index df7e3f9766c16c013b164dfe42343366881c795f..ed351409175293d530f91d9b5d5c9f4620e30b28 100644 (file)
@@ -103,7 +103,7 @@ class PatchNotificationModelTest(TestCase):
         self.assertEqual(PatchChangeNotification.objects.count(), 1)
         notification = PatchChangeNotification.objects.all()[0]
         self.assertEqual(notification.orig_state, oldstate)
-        self.assertTrue(notification.last_modified > orig_timestamp)
+        self.assertTrue(notification.last_modified >= orig_timestamp)
 
     def testProjectNotificationsDisabled(self):
         """Ensure we don't see notifications created when a project is