1
0
mirror of https://github.com/django/django.git synced 2025-10-27 15:46:10 +00:00

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.
This commit is contained in:
MattBlack85
2014-02-16 14:47:51 +01:00
committed by Honza Král
parent 8274fa60f8
commit a8ba76c2d3
4 changed files with 31 additions and 5 deletions

View File

@@ -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):