summaryrefslogtreecommitdiff
path: root/tests/responses/test_cookie.py
diff options
context:
space:
mode:
authorOsaetin Daniel <osaetindaniel@gmail.com>2019-10-09 07:42:55 -0400
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-12-12 10:52:31 +0100
commitb33bfc383935cd26e19a2cf71d066ac6edd1425f (patch)
tree660d196a06d609d7ed98c4052c93d584fb2b5948 /tests/responses/test_cookie.py
parent14e690ae5a6d4ddeb1ac021f78e2e6e333214ef8 (diff)
downloaddjango-b33bfc383935cd26e19a2cf71d066ac6edd1425f.tar.gz
Fixed #30862 -- Allowed setting SameSite cookies flags to 'none'.
Thanks Florian Apolloner and Carlton Gibson for reviews.
Diffstat (limited to 'tests/responses/test_cookie.py')
-rw-r--r--tests/responses/test_cookie.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/responses/test_cookie.py b/tests/responses/test_cookie.py
index ed881435e4..36cb43ed81 100644
--- a/tests/responses/test_cookie.py
+++ b/tests/responses/test_cookie.py
@@ -81,13 +81,16 @@ class SetCookieTests(SimpleTestCase):
def test_samesite(self):
response = HttpResponse()
+ response.set_cookie('example', samesite='None')
+ self.assertEqual(response.cookies['example']['samesite'], 'None')
response.set_cookie('example', samesite='Lax')
self.assertEqual(response.cookies['example']['samesite'], 'Lax')
response.set_cookie('example', samesite='strict')
self.assertEqual(response.cookies['example']['samesite'], 'strict')
def test_invalid_samesite(self):
- with self.assertRaisesMessage(ValueError, 'samesite must be "lax" or "strict".'):
+ msg = 'samesite must be "lax", "none", or "strict".'
+ with self.assertRaisesMessage(ValueError, msg):
HttpResponse().set_cookie('example', samesite='invalid')