From 384d381acf5c90c31c18cd703dd185cceca20f9c Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Tue, 1 Dec 2020 15:26:15 +0100 Subject: [PATCH] more testing. --- src/documents/tests/test_tasks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/documents/tests/test_tasks.py b/src/documents/tests/test_tasks.py index d408c1e3d..6d04e58e1 100644 --- a/src/documents/tests/test_tasks.py +++ b/src/documents/tests/test_tasks.py @@ -1,6 +1,7 @@ from datetime import datetime from django.test import TestCase +from django.utils import timezone from documents import tasks from documents.models import Document @@ -10,12 +11,12 @@ from documents.tests.utils import DirectoriesMixin class TestTasks(DirectoriesMixin, TestCase): def test_index_reindex(self): - Document.objects.create(title="test", content="my document", checksum="wow", added=datetime.now(), created=datetime.now(), modified=datetime.now()) + Document.objects.create(title="test", content="my document", checksum="wow", added=timezone.now(), created=timezone.now(), modified=timezone.now()) tasks.index_reindex() def test_index_optimize(self): - Document.objects.create(title="test", content="my document", checksum="wow", added=datetime.now(), created=datetime.now(), modified=datetime.now()) + Document.objects.create(title="test", content="my document", checksum="wow", added=timezone.now(), created=timezone.now(), modified=timezone.now()) tasks.index_optimize()