summaryrefslogtreecommitdiff
path: root/tests/csrf_tests/test_context_processor.py
diff options
context:
space:
mode:
authorChris Jerdonek <chris.jerdonek@gmail.com>2021-08-17 09:13:13 -0400
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-11-29 10:47:39 +0100
commit5d80843ebc5376d00f98bf2a6aadbada4c29365c (patch)
treef3886af181e6ef4f0cacfa8192e0815de1ac26a9 /tests/csrf_tests/test_context_processor.py
parent05e29da4212fa9f590d7bd10767ebacb25acfde9 (diff)
Fixed #32800 -- Changed CsrfViewMiddleware not to mask the CSRF secret.
This also adds CSRF_COOKIE_MASKED transitional setting helpful in migrating multiple instance of the same project to Django 4.1+. Thanks Florian Apolloner and Shai Berger for reviews. Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Diffstat (limited to 'tests/csrf_tests/test_context_processor.py')
-rw-r--r--tests/csrf_tests/test_context_processor.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/csrf_tests/test_context_processor.py b/tests/csrf_tests/test_context_processor.py
index 0949ed4e34..26a2b7aedb 100644
--- a/tests/csrf_tests/test_context_processor.py
+++ b/tests/csrf_tests/test_context_processor.py
@@ -9,7 +9,7 @@ class TestContextProcessor(CsrfFunctionTestMixin, SimpleTestCase):
def test_force_token_to_string(self):
request = HttpRequest()
- test_token = '1bcdefghij2bcdefghij3bcdefghij4bcdefghij5bcdefghij6bcdefghijABCD'
- request.META['CSRF_COOKIE'] = test_token
+ test_secret = 32 * 'a'
+ request.META['CSRF_COOKIE'] = test_secret
token = csrf(request).get('csrf_token')
- self.assertMaskedSecretCorrect(token, 'lcccccccX2kcccccccY2jcccccccssIC')
+ self.assertMaskedSecretCorrect(token, test_secret)