summaryrefslogtreecommitdiff
path: root/tests/modeltests/test_client/models.py
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2008-07-12 06:16:42 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2008-07-12 06:16:42 +0000
commit4aa6c5725137dc47e3baf4d9df94352e529fa3f4 (patch)
tree42241aa9d41bd74275be90d2363b01730a4fa6d9 /tests/modeltests/test_client/models.py
parentb038abe1fe0c5abc2f503eb8e464087349766c1c (diff)
Fixed #7583 -- Corrected the testing docs that referred to the defunct headers attribute of the response. Added a test case to validate (and document) the new behavior. Thanks to Malcolm for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7900 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/modeltests/test_client/models.py')
-rw-r--r--tests/modeltests/test_client/models.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/modeltests/test_client/models.py b/tests/modeltests/test_client/models.py
index 1a6e1bdc18..3797bf2d52 100644
--- a/tests/modeltests/test_client/models.py
+++ b/tests/modeltests/test_client/models.py
@@ -70,7 +70,13 @@ class ClientTest(TestCase):
self.assertEqual(response.context['data'], '37')
self.assertEqual(response.template.name, 'POST Template')
self.failUnless('Data received' in response.content)
-
+
+ def test_response_headers(self):
+ "Check the value of HTTP headers returned in a response"
+ response = self.client.get("/test_client/header_view/")
+
+ self.assertEquals(response['X-DJANGO-TEST'], 'Slartibartfast')
+
def test_raw_post(self):
"POST raw data (with a content type) to a view"
test_doc = """<?xml version="1.0" encoding="utf-8"?><library><book><title>Blink</title><author>Malcolm Gladwell</author></book></library>"""