diff --git a/mayan/apps/document_signatures/tests/test_models.py b/mayan/apps/document_signatures/tests/test_models.py index c184ffc37f..28678dbac1 100644 --- a/mayan/apps/document_signatures/tests/test_models.py +++ b/mayan/apps/document_signatures/tests/test_models.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals import os +import time from django.conf import settings from django.core.files.base import File @@ -57,6 +58,11 @@ class DocumentTestCase(TestCase): file_object=File(file_object), comment='test comment 1' ) + # Artifical delay since MySQL doesn't store microsecond data in + # timestamps. Version timestamp is used to determine which version + # is the latest. + time.sleep(1) + self.assertEqual( DocumentVersionSignature.objects.has_detached_signature( self.document.latest_version diff --git a/mayan/apps/documents/tests/test_api.py b/mayan/apps/documents/tests/test_api.py index 9b00e9df19..9fa1bc02f5 100644 --- a/mayan/apps/documents/tests/test_api.py +++ b/mayan/apps/documents/tests/test_api.py @@ -178,6 +178,10 @@ class DocumentAPITestCase(APITestCase): file_object=File(file_object), ) + # Artifical delay since MySQL doesn't store microsecond data in + # timestamps. Version timestamp is used to determine which version + # is the latest. + time.sleep(1) with open(TEST_DOCUMENT_PATH) as file_descriptor: response = self.client.post( reverse(