Add 1 second delay to workaround MySQL <5.6.4 not storing millisecond time data which is used to determine lastest version of a document.

This commit is contained in:
Roberto Rosario
2015-09-21 04:19:57 -04:00
parent 79823ec531
commit 6ccfaf59f8
2 changed files with 10 additions and 0 deletions

View File

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

View File

@@ -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(