diff options
| author | Chris Jerdonek <chris.jerdonek@gmail.com> | 2021-05-31 04:26:11 -0700 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-06-01 09:02:27 +0200 |
| commit | cd19db10df6225e01b77685397a88c9cdf216dd1 (patch) | |
| tree | f00918fc29389fa81001c0fa3650d398dd1afcbe /tests/csrf_tests | |
| parent | 623cec0879e09e8ad804c213157e51e764f5d826 (diff) | |
Fixed #32796 -- Changed CsrfViewMiddleware to fail earlier on badly formatted cookie tokens.
Diffstat (limited to 'tests/csrf_tests')
| -rw-r--r-- | tests/csrf_tests/tests.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/csrf_tests/tests.py b/tests/csrf_tests/tests.py index f68828065f..7cf69fd6c5 100644 --- a/tests/csrf_tests/tests.py +++ b/tests/csrf_tests/tests.py @@ -863,14 +863,14 @@ class CsrfViewMiddlewareTests(CsrfViewMiddlewareTestMixin, SimpleTestCase): If the CSRF cookie has invalid characters in a POST request, the middleware rejects the incoming request. """ - self._check_bad_or_missing_cookie(64 * '*', REASON_CSRF_TOKEN_MISSING) + self._check_bad_or_missing_cookie(64 * '*', 'CSRF cookie has invalid characters.') def test_bad_csrf_cookie_length(self): """ If the CSRF cookie has an incorrect length in a POST request, the middleware rejects the incoming request. """ - self._check_bad_or_missing_cookie(16 * 'a', REASON_CSRF_TOKEN_MISSING) + self._check_bad_or_missing_cookie(16 * 'a', 'CSRF cookie has incorrect length.') def test_process_view_token_too_long(self): """ |
