Made the test timezone aware, DateTimeFiled(auto_now_add) already was.

This commit is contained in:
Marcus Scholz 2020-09-11 22:22:03 +02:00
parent c78858c152
commit aed2856df3

View File

@ -2,6 +2,7 @@ import datetime
from django.test import TestCase
from django.db import models
from django.utils import timezone
from lostplaces_app.models import Voucher
from lostplaces_app.tests.models import ModelTestCase
@ -10,7 +11,7 @@ from lostplaces_app.tests.models import ModelTestCase
def mock_voucher():
return Voucher.objects.create(
code='ayDraJCCwfhcFiYmSR5GrcjcchDfcahv',
expires_when=datetime.datetime.now() + datetime.timedelta(days=1)
expires_when=timezone.now() + datetime.timedelta(days=1)
)