

def test_error_writer(self):
    response = self.request('/nodebug-api-error')
    json = tornado.escape.json_decode(response.body)
    self.assertEqual(response.code, 401)
    self.assertEqual(response.headers['Content-Type'], 'application/json; charset=UTF-8')
    self.assertEqual(json['code'], 401)
    self.assertEqual(json['error'], 'Test 3')
    self.assertTrue(('trace' not in json))

dataset/ETHPy150Open dailymuse/oz/oz/json_api/tests/test_middleware.py NoDebugApiMiddlewareTestCase.test_error_writer/original