summaryrefslogtreecommitdiff
path: root/tests/csrf_tests
diff options
context:
space:
mode:
authorFrançois Freitag <mail@franek.fr>2021-01-07 17:54:40 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-03-02 20:35:33 +0100
commit7ca7f4495ba746279b734695a8dd137bf7ee0bab (patch)
tree671066b8a0f4a75d9481e0ce89bd12f7c7b34898 /tests/csrf_tests
parentd3ecef26b9fda02b88f925a800ae38dd5873c878 (diff)
downloaddjango-7ca7f4495ba746279b734695a8dd137bf7ee0bab.tar.gz
Refs #21429 -- Added SimpleTestCase.assertNoLogs() on Python < 3.10.
Diffstat (limited to 'tests/csrf_tests')
-rw-r--r--tests/csrf_tests/tests.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/csrf_tests/tests.py b/tests/csrf_tests/tests.py
index 63a2d478b4..b1b37c8601 100644
--- a/tests/csrf_tests/tests.py
+++ b/tests/csrf_tests/tests.py
@@ -454,10 +454,9 @@ class CsrfViewMiddlewareTestMixin:
"""
ensure_csrf_cookie() doesn't log warnings (#19436).
"""
- with self.assertRaisesMessage(AssertionError, 'no logs'):
- with self.assertLogs('django.request', 'WARNING'):
- req = self._get_GET_no_csrf_cookie_request()
- ensure_csrf_cookie_view(req)
+ with self.assertNoLogs('django.request', 'WARNING'):
+ req = self._get_GET_no_csrf_cookie_request()
+ ensure_csrf_cookie_view(req)
def test_post_data_read_failure(self):
"""