def test_respond(self):
        # Checks w/ JSONP support
        response = self.request("/response")
        self.assertEqual(response.headers["Content-Type"], "application/json; charset=UTF-8")
        self.assertEqual(response.body, b'{"hello": "world"}')

        response = self.request("/response?callback=foo")
        self.assertEqual(response.headers["Content-Type"], "application/javascript; charset=UTF-8")
        self.assertEqual(response.body, b'foo({"hello": "world"})')

        response = self.request('/response?callback=!!!')
        self.assertEqual(response.headers["Content-Type"], "application/json; charset=UTF-8")
        self.assertTrue(b"Invalid callback identifier" in response.body)
dataset/ETHPy150Open dailymuse/oz/oz/json_api/tests/test_middleware.py/ApiMiddlewareTestCase.test_respond/original