def test_json_view():
 response = json_view((lambda r: {'x': 1}))(mock.Mock())
 assert isinstance(response, http.HttpResponse)
 eq_(response.content, '{"x": 1}')
 eq_(response['Content-Type'], 'application/json')
 eq_(response.status_code, 200)

def test_json_view ( ) : response = json_view ( ( lambda r : { 'x' : 1 } ) ) ( mock . Mock ( ) ) assert isinstance ( response , http . HttpResponse ) eq_ ( response . content , '{"x": 1}' ) eq_ ( response [ 'Content-Type' ] , 'application/json' ) eq_ ( response . status_code , 200 )
turns a python object into a response .