def render(self, data, media_type=None, renderer_context=None): codec = CoreJSONCodec() return codec.dump(data, indent=True)
def mockreturn(self, request): codec = CoreJSONCodec() body = force_text(request.body) content = codec.dump(Document(content={'data': json.loads(body)})) return MockResponse(content)