From aed2856df34bab49e99680f2f5f113c1d828b294 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Fri, 11 Sep 2020 22:22:03 +0200 Subject: [PATCH] Made the test timezone aware, DateTimeFiled(auto_now_add) already was. --- lostplaces/lostplaces_app/tests/models/test_voucher_model.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lostplaces/lostplaces_app/tests/models/test_voucher_model.py b/lostplaces/lostplaces_app/tests/models/test_voucher_model.py index 5ab7b4b..608f38b 100644 --- a/lostplaces/lostplaces_app/tests/models/test_voucher_model.py +++ b/lostplaces/lostplaces_app/tests/models/test_voucher_model.py @@ -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) )