summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2014-12-16 13:22:38 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2014-12-16 13:22:38 +0100
commit2cb9d984cf7a0965ca6b1322ab836d56278f8749 (patch)
treeccdb96a09a64bc052934a516dd48817784df55fd /tests
parent4efe1b79e9462318ff8b2c76a09c5925ad0e0f7c (diff)
parent4fada6f1c9930e589aebe8bdfb5795f69d253c07 (diff)
Merge pull request #3737 from mhall1/ticket_23893
Fixed #23893: Added tzinfo to constant datetime in unit test
Diffstat (limited to 'tests')
-rw-r--r--tests/custom_lookups/tests.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/custom_lookups/tests.py b/tests/custom_lookups/tests.py
index e9a205be5b..945c33a0ec 100644
--- a/tests/custom_lookups/tests.py
+++ b/tests/custom_lookups/tests.py
@@ -8,6 +8,7 @@ from django.core.exceptions import FieldError
from django.db import models
from django.db import connection
from django.test import TestCase, override_settings
+from django.utils import timezone
from .models import Author, MySQLUnixTimestamp
@@ -376,7 +377,7 @@ class DateTimeLookupTests(TestCase):
models.PositiveIntegerField.register_lookup(DateTimeTransform)
try:
ut = MySQLUnixTimestamp.objects.create(timestamp=time.time())
- y2k = datetime(2000, 1, 1)
+ y2k = timezone.make_aware(datetime(2000, 1, 1))
self.assertQuerysetEqual(
MySQLUnixTimestamp.objects.filter(timestamp__as_datetime__gt=y2k),
[ut], lambda x: x)