mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #27863 -- Added support for the SameSite cookie flag.
Thanks Alex Gaynor for contributing to the patch.
This commit is contained in:
@@ -57,6 +57,7 @@ class CookieTests(BaseTests, SimpleTestCase):
|
||||
# The message contains what's expected.
|
||||
self.assertEqual(list(storage), example_messages)
|
||||
|
||||
@override_settings(SESSION_COOKIE_SAMESITE='Strict')
|
||||
def test_cookie_setings(self):
|
||||
"""
|
||||
CookieStorage honors SESSION_COOKIE_DOMAIN, SESSION_COOKIE_SECURE, and
|
||||
@@ -72,6 +73,7 @@ class CookieTests(BaseTests, SimpleTestCase):
|
||||
self.assertEqual(response.cookies['messages']['expires'], '')
|
||||
self.assertIs(response.cookies['messages']['secure'], True)
|
||||
self.assertIs(response.cookies['messages']['httponly'], True)
|
||||
self.assertEqual(response.cookies['messages']['samesite'], 'Strict')
|
||||
|
||||
# Test deletion of the cookie (storing with an empty value) after the messages have been consumed
|
||||
storage = self.get_storage()
|
||||
|
||||
Reference in New Issue
Block a user