Ticket #14020: 14020_with_tests.patch
File 14020_with_tests.patch, 1.2 KB (added by , 13 years ago) |
---|
-
django/http/__init__.py
570 570 def items(self): 571 571 return self._headers.values() 572 572 573 def get(self, header, alternate ):573 def get(self, header, alternate=None): 574 574 return self._headers.get(header.lower(), (None, alternate))[1] 575 575 576 576 def set_cookie(self, key, value='', max_age=None, expires=None, path='/', -
tests/regressiontests/httpwrappers/tests.py
243 243 self.assertRaises(BadHeaderError, r.__setitem__, 'test\rstr', 'test') 244 244 self.assertRaises(BadHeaderError, r.__setitem__, 'test\nstr', 'test') 245 245 246 def test_dict_behavior(self): 247 """ 248 Test for bug #14020: Make HttpResponse.get work like dict.get 249 """ 250 r = HttpResponse() 251 self.assertEqual(r.get('test'), None) 252 246 253 class CookieTests(unittest.TestCase): 247 254 def test_encode(self): 248 255 """