From b085e7c3033d49e4d7525bacb1f34340730918a8 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sun, 8 Sep 2013 20:43:04 +0200 Subject: [PATCH] [1.6.x] Further hardening. Refs #18766. Backport of c687bf0 from master. --- tests/utils_tests/test_timezone.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/utils_tests/test_timezone.py b/tests/utils_tests/test_timezone.py index 2d14c85234..c8d2c4c73a 100644 --- a/tests/utils_tests/test_timezone.py +++ b/tests/utils_tests/test_timezone.py @@ -25,10 +25,10 @@ class TimezoneTests(unittest.TestCase): long_ago = datetime.datetime(1900, 1, 1, tzinfo=timezone.utc) try: timezone.localtime(long_ago, local_tz) - except OverflowError as exc: + except (OverflowError, ValueError) as exc: self.assertIn("install pytz", exc.args[0]) else: - raise unittest.SkipTest("Failed to trigger an OverflowError") + raise unittest.SkipTest("Failed to trigger an OverflowError or ValueError") def test_now(self): with override_settings(USE_TZ=True):