diff options
author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-01-14 10:27:04 +0100 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-01-14 17:50:04 +0100 |
commit | 0aa6a602b2b1cac6fe8e55051eed493b9cea7b81 (patch) | |
tree | 172a55c26ec312e4988c40647632ecd9f866880f /tests/signing | |
parent | e7208f13c0448387e56c340eed46e1ed9ef9997e (diff) | |
download | django-0aa6a602b2b1cac6fe8e55051eed493b9cea7b81.tar.gz |
Refs #31842 -- Removed DEFAULT_HASHING_ALGORITHM transitional setting.
Per deprecation timeline.
Diffstat (limited to 'tests/signing')
-rw-r--r-- | tests/signing/tests.py | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/tests/signing/tests.py b/tests/signing/tests.py index f4c20b9aff..4b9cec7d25 100644 --- a/tests/signing/tests.py +++ b/tests/signing/tests.py @@ -2,9 +2,8 @@ import datetime from django.core import signing from django.test import SimpleTestCase -from django.test.utils import freeze_time, ignore_warnings +from django.test.utils import freeze_time from django.utils.crypto import InvalidAlgorithm -from django.utils.deprecation import RemovedInDjango40Warning class TestSigner(SimpleTestCase): @@ -53,14 +52,6 @@ class TestSigner(SimpleTestCase): 'VzO9_jVu7R-VkqknHYNvw', ) - @ignore_warnings(category=RemovedInDjango40Warning) - def test_default_hashing_algorithm(self): - signer = signing.Signer('predictable-secret', algorithm='sha1') - signature_sha1 = signer.signature('hello') - with self.settings(DEFAULT_HASHING_ALGORITHM='sha1'): - signer = signing.Signer('predictable-secret') - self.assertEqual(signer.signature('hello'), signature_sha1) - def test_invalid_algorithm(self): signer = signing.Signer('predictable-secret', algorithm='whatever') msg = "'whatever' is not an algorithm accepted by the hashlib module." @@ -143,13 +134,6 @@ class TestSigner(SimpleTestCase): self.assertNotEqual(o, signing.dumps(o, compress=True)) self.assertEqual(o, signing.loads(signing.dumps(o, compress=True))) - @ignore_warnings(category=RemovedInDjango40Warning) - def test_dumps_loads_default_hashing_algorithm_sha1(self): - value = 'a string \u2020' - with self.settings(DEFAULT_HASHING_ALGORITHM='sha1'): - signed = signing.dumps(value) - self.assertEqual(signing.loads(signed), value) - def test_decode_detects_tampering(self): "loads should raise exception for tampered objects" transforms = ( |