From: Damien Lespiau Date: Sat, 8 Nov 2014 13:25:58 +0000 (+0000) Subject: test_notifications: Fix testNotificationUpdated timestamp comparison X-Git-Url: http://git.ozlabs.org/?p=patchwork;a=commitdiff_plain;h=8904a7dcaf959da8db4a9a5d92b91a61eed05201;hp=a5d803a565aea5b655058ff244e9ae8356004963 test_notifications: Fix testNotificationUpdated timestamp comparison 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 Signed-off-by: Jeremy Kerr --- diff --git a/apps/patchwork/tests/test_notifications.py b/apps/patchwork/tests/test_notifications.py index df7e3f9..ed35140 100644 --- a/apps/patchwork/tests/test_notifications.py +++ b/apps/patchwork/tests/test_notifications.py @@ -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