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:
@@ -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):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user