From 6cd0394e20c16828d14257a7360e9abef2c3e674 Mon Sep 17 00:00:00 2001 From: Keats Date: Fri, 21 Feb 2014 17:12:41 +0000 Subject: Display the media type of the API response on the browsable API --- rest_framework/tests/test_renderers.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'rest_framework/tests/test_renderers.py') 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}' -- cgit v1.2.3