diff options
Diffstat (limited to 'tests/responses/tests.py')
| -rw-r--r-- | tests/responses/tests.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/responses/tests.py b/tests/responses/tests.py index 9642790b9a..892c09b857 100644 --- a/tests/responses/tests.py +++ b/tests/responses/tests.py @@ -33,6 +33,20 @@ class HttpResponseBaseTests(SimpleTestCase): with self.assertRaisesMessage(IOError, 'This HttpResponseBase instance cannot tell its position'): r.tell() + def test_setdefault(self): + """ + HttpResponseBase.setdefault() should not change an existing header + and should be case insensitive. + """ + r = HttpResponseBase() + + r['Header'] = 'Value' + r.setdefault('header', 'changed') + self.assertEqual(r['header'], 'Value') + + r.setdefault('x-header', 'DefaultValue') + self.assertEqual(r['X-Header'], 'DefaultValue') + class HttpResponseTests(SimpleTestCase): def test_status_code(self): |
