mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #27863 -- Added support for the SameSite cookie flag.
Thanks Alex Gaynor for contributing to the patch.
This commit is contained in:
@@ -746,6 +746,11 @@ class CookieTests(unittest.TestCase):
|
||||
# document.cookie parses whitespace.
|
||||
self.assertEqual(parse_cookie(' = b ; ; = ; c = ; '), {'': 'b', 'c': ''})
|
||||
|
||||
def test_samesite(self):
|
||||
c = SimpleCookie('name=value; samesite=lax; httponly')
|
||||
self.assertEqual(c['name']['samesite'], 'lax')
|
||||
self.assertIn('SameSite=lax', c.output())
|
||||
|
||||
def test_httponly_after_load(self):
|
||||
c = SimpleCookie()
|
||||
c.load("name=val")
|
||||
|
||||
Reference in New Issue
Block a user