mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #27327 -- Simplified time zone handling by requiring pytz.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from datetime import datetime
|
||||
from unittest import skipIf
|
||||
|
||||
import pytz
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import connection
|
||||
@@ -16,11 +17,6 @@ from django.utils import timezone
|
||||
|
||||
from .models import DTModel
|
||||
|
||||
try:
|
||||
import pytz
|
||||
except ImportError:
|
||||
pytz = None
|
||||
|
||||
|
||||
def microsecond_support(value):
|
||||
return value if connection.features.supports_microsecond_precision else value.replace(microsecond=0)
|
||||
@@ -659,7 +655,6 @@ class DateFunctionTests(TestCase):
|
||||
list(DTModel.objects.annotate(truncated=TruncSecond('start_date', output_field=DateField())))
|
||||
|
||||
|
||||
@skipIf(pytz is None, "this test requires pytz")
|
||||
@override_settings(USE_TZ=True, TIME_ZONE='UTC')
|
||||
class DateFunctionWithTimeZoneTests(DateFunctionTests):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user