mirror of
https://github.com/django/django.git
synced 2025-08-18 09:40:51 +00:00
Inputs acceptable to time.mktime are platform-dependent.
Backport of 1a1e1478
from master.
This commit is contained in:
parent
7c31e195db
commit
0035a0ce2e
1 changed files with 5 additions and 1 deletions
|
@ -23,8 +23,12 @@ class TimezoneTests(unittest.TestCase):
|
||||||
def test_localtime_out_of_range(self):
|
def test_localtime_out_of_range(self):
|
||||||
local_tz = timezone.LocalTimezone()
|
local_tz = timezone.LocalTimezone()
|
||||||
long_ago = datetime.datetime(1900, 1, 1, tzinfo=timezone.utc)
|
long_ago = datetime.datetime(1900, 1, 1, tzinfo=timezone.utc)
|
||||||
with six.assertRaisesRegex(self, OverflowError, "install pytz"):
|
try:
|
||||||
timezone.localtime(long_ago, local_tz)
|
timezone.localtime(long_ago, local_tz)
|
||||||
|
except OverflowError as exc:
|
||||||
|
self.assertIn("install pytz", exc.args[0])
|
||||||
|
else:
|
||||||
|
raise unittest.SkipTest("Failed to trigger an OverflowError")
|
||||||
|
|
||||||
def test_now(self):
|
def test_now(self):
|
||||||
with override_settings(USE_TZ=True):
|
with override_settings(USE_TZ=True):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue