Fixed #27327 -- Simplified time zone handling by requiring pytz.

This commit is contained in:
Tim Graham 2016-10-07 21:06:49 -04:00
parent d84ffcc22b
commit 414ad25b09
30 changed files with 109 additions and 426 deletions

View file

@ -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))