Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.6.x] Hardened the test introduced in ded11aa. Refs #18766.

Inputs acceptable to time.mktime are platform-dependent.

Backport of 1a1e147 from master.
  • Loading branch information...
commit 0035a0ce2ec243ff9255157117c20caf41a61284 1 parent 7c31e19
Aymeric Augustin authored September 08, 2013

Showing 1 changed file with 5 additions and 1 deletion. Show diff stats Hide diff stats

  1. 6  tests/utils_tests/test_timezone.py
6  tests/utils_tests/test_timezone.py
@@ -23,8 +23,12 @@ def test_localtime(self):
23 23
     def test_localtime_out_of_range(self):
24 24
         local_tz = timezone.LocalTimezone()
25 25
         long_ago = datetime.datetime(1900, 1, 1, tzinfo=timezone.utc)
26  
-        with six.assertRaisesRegex(self, OverflowError, "install pytz"):
  26
+        try:
27 27
             timezone.localtime(long_ago, local_tz)
  28
+        except OverflowError as exc:
  29
+            self.assertIn("install pytz", exc.args[0])
  30
+        else:
  31
+            raise unittest.SkipTest("Failed to trigger an OverflowError")
28 32
 
29 33
     def test_now(self):
30 34
         with override_settings(USE_TZ=True):

0 notes on commit 0035a0c

Please sign in to comment.
Something went wrong with that request. Please try again.