mirror of
https://github.com/django/django.git
synced 2025-07-24 13:44:32 +00:00
Fixed #27327 -- Simplified time zone handling by requiring pytz.
This commit is contained in:
parent
d84ffcc22b
commit
414ad25b09
30 changed files with 109 additions and 426 deletions
|
@ -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):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue