aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/tests
diff options
context:
space:
mode:
authorKeats2014-02-21 17:12:41 +0000
committerKeats2014-02-26 23:47:35 +0000
commit6cd0394e20c16828d14257a7360e9abef2c3e674 (patch)
treebf7ab15a2ea0530bbaea448012e48d7d9581f8d3 /rest_framework/tests
parent6e92e415aa7dd6871ef7d6500a85cacebde8dca2 (diff)
downloaddjango-rest-framework-6cd0394e20c16828d14257a7360e9abef2c3e674.tar.bz2
Display the media type of the API response on the browsable API
Diffstat (limited to 'rest_framework/tests')
-rw-r--r--rest_framework/tests/test_renderers.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/rest_framework/tests/test_renderers.py b/rest_framework/tests/test_renderers.py
index fb33df2c..0f3432c9 100644
--- a/rest_framework/tests/test_renderers.py
+++ b/rest_framework/tests/test_renderers.py
@@ -256,6 +256,18 @@ class RendererEndToEndTests(TestCase):
self.assertEqual(resp.get('Content-Type', None), None)
self.assertEqual(resp.status_code, status.HTTP_204_NO_CONTENT)
+ def test_contains_headers_of_api_response(self):
+ """
+ Issue #1437
+
+ Test we display the headers of the API response and not those from the
+ HTML response
+ """
+ resp = self.client.get('/html1')
+ self.assertContains(resp, '>GET, HEAD, OPTIONS<')
+ self.assertContains(resp, '>application/json<')
+ self.assertNotContains(resp, '>text/html; charset=utf-8<')
+
_flat_repr = '{"foo": ["bar", "baz"]}'
_indented_repr = '{\n "foo": [\n "bar",\n "baz"\n ]\n}'