aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/tests/test_renderers.py
diff options
context:
space:
mode:
authorTom Christie2014-02-28 11:55:45 +0000
committerTom Christie2014-02-28 11:55:45 +0000
commit22f225175ff29e77bec95129a8e812c791777f10 (patch)
tree00cd7b52dd194f81cdd66cbd1588dcc698eda7dc /rest_framework/tests/test_renderers.py
parent22576013b9c38f4acdd1b845612dde1d4035240a (diff)
parent6cd0394e20c16828d14257a7360e9abef2c3e674 (diff)
downloaddjango-rest-framework-22f225175ff29e77bec95129a8e812c791777f10.tar.bz2
Merge pull request #1437 from Keats/master
Display the media type of the API response on the browsable API
Diffstat (limited to 'rest_framework/tests/test_renderers.py')
-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}'