Kaydet (Commit) c687bf06 authored tarafından Aymeric Augustin's avatar Aymeric Augustin

Further hardening. Refs #18766.

üst 1a1e1478
...@@ -26,10 +26,10 @@ class TimezoneTests(unittest.TestCase): ...@@ -26,10 +26,10 @@ class TimezoneTests(unittest.TestCase):
long_ago = datetime.datetime(1900, 1, 1, tzinfo=timezone.utc) long_ago = datetime.datetime(1900, 1, 1, tzinfo=timezone.utc)
try: try:
timezone.localtime(long_ago, local_tz) timezone.localtime(long_ago, local_tz)
except OverflowError as exc: except (OverflowError, ValueError) as exc:
self.assertIn("install pytz", exc.args[0]) self.assertIn("install pytz", exc.args[0])
else: else:
raise unittest.SkipTest("Failed to trigger an OverflowError") raise unittest.SkipTest("Failed to trigger an OverflowError or ValueError")
def test_now(self): def test_now(self):
with override_settings(USE_TZ=True): with override_settings(USE_TZ=True):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment