[PATCH 2/2] test_notifications: Fix testNotificationUpdated timestamp comparison

Damien Lespiau damien.lespiau at intel.com
Sun Nov 9 00:25:58 AEDT 2014


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 at intel.com>
---
 apps/patchwork/tests/test_notifications.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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
-- 
1.8.3.1



More information about the Patchwork mailing list