mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +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,18 +1,12 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import datetime
|
||||
from unittest import skipIf
|
||||
|
||||
from django.test import TestCase, override_settings
|
||||
from django.utils import timezone
|
||||
|
||||
from .models import Article, Category, Comment
|
||||
|
||||
try:
|
||||
import pytz
|
||||
except ImportError:
|
||||
pytz = None
|
||||
|
||||
|
||||
class DateTimesTests(TestCase):
|
||||
def test_related_model_traverse(self):
|
||||
|
@ -84,7 +78,6 @@ class DateTimesTests(TestCase):
|
|||
],
|
||||
)
|
||||
|
||||
@skipIf(pytz is None, "this test requires pytz")
|
||||
@override_settings(USE_TZ=True)
|
||||
def test_21432(self):
|
||||
now = timezone.localtime(timezone.now().replace(microsecond=0))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue