summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRamiro Morales <cramm0@gmail.com>2011-02-13 02:24:05 +0000
committerRamiro Morales <cramm0@gmail.com>2011-02-13 02:24:05 +0000
commitf6aa469b1da50228b7e082c4ac0ecbe57575a373 (patch)
treeac82170632b03cd43b3a3f236a80f225f7e3a4e2 /tests
parenta797b7dba0644558ca7bf825b22268f2b4d9d3b5 (diff)
Fixed #13007 -- Made cookie parsing resilent to the presence of cookies with invalid characters in their names. Thanks Warlax for the report, Ubercore for his work on a fix and Jannis and Luke for review and guidance.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15523 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/httpwrappers/tests.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/regressiontests/httpwrappers/tests.py b/tests/regressiontests/httpwrappers/tests.py
index 69b052f5cd..7d6641a3d7 100644
--- a/tests/regressiontests/httpwrappers/tests.py
+++ b/tests/regressiontests/httpwrappers/tests.py
@@ -1,7 +1,8 @@
import copy
import pickle
-from django.http import QueryDict, HttpResponse, SimpleCookie, BadHeaderError
+from django.http import (QueryDict, HttpResponse, SimpleCookie, BadHeaderError,
+ parse_cookie)
from django.utils import unittest
class QueryDictTests(unittest.TestCase):
@@ -274,3 +275,9 @@ class CookieTests(unittest.TestCase):
c2 = SimpleCookie()
c2.load(c.output())
self.assertEqual(c['test'].value, c2['test'].value)
+
+ def test_nonstandard_keys(self):
+ """
+ Test that a single non-standard cookie name doesn't affect all cookies. Ticket #13007.
+ """
+ self.assertTrue('good_cookie' in parse_cookie('good_cookie=yes;bad:cookie=yes').keys())