summaryrefslogtreecommitdiff
path: root/tests/httpwrappers
diff options
context:
space:
mode:
authore0ne <e0ne@e0ne.info>2013-09-09 12:40:37 +0300
committerTim Graham <timograham@gmail.com>2013-09-10 08:26:54 -0400
commitf2a44528825ac07ca28c8bb7dc01b4375df8dc2c (patch)
tree6eeef84ddd28366a626669d0a79ad277ef51f8c0 /tests/httpwrappers
parent7008ed61c519f93a9b6c5c547ad718ad2deb959b (diff)
Fixed #18403 -- Initialized bad_cookies in SimpleCookie
Thanks Stefano Crosta for the report.
Diffstat (limited to 'tests/httpwrappers')
-rw-r--r--tests/httpwrappers/tests.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/httpwrappers/tests.py b/tests/httpwrappers/tests.py
index 17bb98e24d..287d800c21 100644
--- a/tests/httpwrappers/tests.py
+++ b/tests/httpwrappers/tests.py
@@ -618,3 +618,12 @@ class CookieTests(unittest.TestCase):
c = SimpleCookie()
c.load({'name': 'val'})
self.assertEqual(c['name'].value, 'val')
+
+ @unittest.skipUnless(six.PY2, "PY3 throws an exception on invalid cookie keys.")
+ def test_bad_cookie(self):
+ """
+ Regression test for #18403
+ """
+ r = HttpResponse()
+ r.set_cookie("a:.b/", 1)
+ self.assertEqual(len(r.cookies.bad_cookies), 1)