diff options
| author | Tim Graham <timograham@gmail.com> | 2015-09-05 10:31:09 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-09-23 19:31:11 -0400 |
| commit | e6cfa08f2d478cb962528188dff5cf4daf5e5f9b (patch) | |
| tree | 98ac349152a008c1c2e4e6c9d6d04bc92481484c /tests | |
| parent | 9114fe8adabe626619665c9853ba952798da5530 (diff) | |
Refs #22804 -- Made an unsafe value of 'sep' in Signer an exception.
Per deprecation timeline.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/signing/tests.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/signing/tests.py b/tests/signing/tests.py index a8de1b0cbc..1d084e0252 100644 --- a/tests/signing/tests.py +++ b/tests/signing/tests.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals import datetime -import warnings from django.core import signing from django.test import SimpleTestCase @@ -121,14 +120,11 @@ class TestSigner(SimpleTestCase): def test_invalid_sep(self): """should warn on invalid separator""" + msg = 'Unsafe Signer separator: %r (cannot be empty or consist of only A-z0-9-_=)' separators = ['', '-', 'abc'] for sep in separators: - with warnings.catch_warnings(record=True) as recorded: - warnings.simplefilter('always') + with self.assertRaisesMessage(ValueError, msg % sep): signing.Signer(sep=sep) - self.assertEqual(len(recorded), 1) - msg = str(recorded[0].message) - self.assertTrue(msg.startswith('Unsafe Signer separator')) class TestTimestampSigner(SimpleTestCase): |
