summaryrefslogtreecommitdiff
path: root/tests/regressiontests
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2011-06-16 16:34:46 +0000
committerJannis Leidel <jannis@leidel.info>2011-06-16 16:34:46 +0000
commitdfa29161e2eff676eb4aa187f76c157556dfc5db (patch)
tree7f8ae90d7f8955a0785e3c4b8e9d5a72d828ff4f /tests/regressiontests
parent22529d41b26137ac87c5e08a6c19e6e91552756e (diff)
Fixed #14020 -- Made the `HttpResponse` class slightly more behave like a dictionary, allowing the alternative argument to be unset. Serious thanks to schmichael and moopet.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16417 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests')
-rw-r--r--tests/regressiontests/httpwrappers/tests.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/regressiontests/httpwrappers/tests.py b/tests/regressiontests/httpwrappers/tests.py
index fbed94413b..493109a38e 100644
--- a/tests/regressiontests/httpwrappers/tests.py
+++ b/tests/regressiontests/httpwrappers/tests.py
@@ -243,6 +243,13 @@ class HttpResponseTests(unittest.TestCase):
self.assertRaises(BadHeaderError, r.__setitem__, 'test\rstr', 'test')
self.assertRaises(BadHeaderError, r.__setitem__, 'test\nstr', 'test')
+ def test_dict_behavior(self):
+ """
+ Test for bug #14020: Make HttpResponse.get work like dict.get
+ """
+ r = HttpResponse()
+ self.assertEqual(r.get('test'), None)
+
class CookieTests(unittest.TestCase):
def test_encode(self):
"""