diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2018-04-13 20:58:31 -0400 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2018-04-13 20:58:31 -0400 |
commit | 9a56b4b13ed92d2d5bb00d6bdb905a73bc5f2f0a (patch) | |
tree | ddb311604d1ec31ec09c8ae12e34dadc821f7536 /tests/httpwrappers | |
parent | 13efbb233a9aa2e3f13be863c6616ec0767a0d58 (diff) | |
download | django-9a56b4b13ed92d2d5bb00d6bdb905a73bc5f2f0a.tar.gz |
Fixed #27863 -- Added support for the SameSite cookie flag.
Thanks Alex Gaynor for contributing to the patch.
Diffstat (limited to 'tests/httpwrappers')
-rw-r--r-- | tests/httpwrappers/tests.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/httpwrappers/tests.py b/tests/httpwrappers/tests.py index a387ca1f74..985380cc57 100644 --- a/tests/httpwrappers/tests.py +++ b/tests/httpwrappers/tests.py @@ -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") |