diff options
Diffstat (limited to 'tests/sessions_tests/tests.py')
| -rw-r--r-- | tests/sessions_tests/tests.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/sessions_tests/tests.py b/tests/sessions_tests/tests.py index 8f3f948f9e..09c21da089 100644 --- a/tests/sessions_tests/tests.py +++ b/tests/sessions_tests/tests.py @@ -660,6 +660,16 @@ class SessionMiddlewareTests(TestCase): str(response.cookies[settings.SESSION_COOKIE_NAME]) ) + @override_settings(SESSION_COOKIE_SAMESITE='Strict') + def test_samesite_session_cookie(self): + request = RequestFactory().get('/') + response = HttpResponse() + middleware = SessionMiddleware() + middleware.process_request(request) + request.session['hello'] = 'world' + response = middleware.process_response(request, response) + self.assertEqual(response.cookies[settings.SESSION_COOKIE_NAME]['samesite'], 'Strict') + @override_settings(SESSION_COOKIE_HTTPONLY=False) def test_no_httponly_session_cookie(self): request = RequestFactory().get('/') |
