

def test_body(self):
    response = self.request('/body', body='{"hello": "world"}', method='PUT')
    self.assertEqual(response.headers['Content-Type'], 'application/json; charset=UTF-8')
    response.assertTrue((b'JSON body expected' in response.body), msg=('Unexpected body: %s' % response.body))
    response = self.request('/body', body='{"hello": "world"}', method='PUT', headers={
        'Content-Type': 'application/json',
    })
    self.assertEqual(response.headers['Content-Type'], 'application/json; charset=UTF-8')
    self.assertEqual(response.body, b'{"hello": "world"}')

dataset/ETHPy150Open dailymuse/oz/oz/json_api/tests/test_middleware.py ApiMiddlewareTestCase.test_body/VarMisuse@41/69 `self`->`response`