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:
@@ -1,6 +1,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import time
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.files.base import File
|
from django.core.files.base import File
|
||||||
@@ -57,6 +58,11 @@ class DocumentTestCase(TestCase):
|
|||||||
file_object=File(file_object), comment='test comment 1'
|
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(
|
self.assertEqual(
|
||||||
DocumentVersionSignature.objects.has_detached_signature(
|
DocumentVersionSignature.objects.has_detached_signature(
|
||||||
self.document.latest_version
|
self.document.latest_version
|
||||||
|
|||||||
@@ -178,6 +178,10 @@ class DocumentAPITestCase(APITestCase):
|
|||||||
file_object=File(file_object),
|
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:
|
with open(TEST_DOCUMENT_PATH) as file_descriptor:
|
||||||
response = self.client.post(
|
response = self.client.post(
|
||||||
reverse(
|
reverse(
|
||||||
|
|||||||
Reference in New Issue
Block a user