diff options
author | MattBlack85 <promat85@gmail.com> | 2014-02-16 14:47:51 +0100 |
---|---|---|
committer | Honza Král <honza.kral@gmail.com> | 2014-02-16 16:50:50 +0100 |
commit | a8ba76c2d3ad95595590af31c5cda123dc3868b7 (patch) | |
tree | a4946df9c6c1ef13d49fe2b142141cba99b2278f /tests/signing | |
parent | 8274fa60f88607eb0e81908f049c391455956dd8 (diff) | |
download | django-a8ba76c2d3ad95595590af31c5cda123dc3868b7.tar.gz |
Fixed #19980: Signer broken for binary keys (with non-ASCII chars).
With this pull request, request #878 should considered closed.
Thanks to nvie for the patch.
Diffstat (limited to 'tests/signing')
-rw-r--r-- | tests/signing/tests.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/signing/tests.py b/tests/signing/tests.py index fc8390e9e8..6d4a5b0cc3 100644 --- a/tests/signing/tests.py +++ b/tests/signing/tests.py @@ -105,6 +105,12 @@ class TestSigner(TestCase): self.assertRaises( signing.BadSignature, signing.loads, transform(encoded)) + def test_works_with_non_ascii_keys(self): + binary_key = b'\xe7' # Set some binary (non-ASCII key) + + s = signing.Signer(binary_key) + self.assertEquals('foo:6NB0fssLW5RQvZ3Y-MTerq2rX7w', s.sign('foo')) + class TestTimestampSigner(TestCase): |