#NEWLINE# def test_create_json_response_with_body( self ) : #NEWLINE# #INDENT# obj = Mock ( status_int = 401 , location = 'http://example.com/api' ) #NEWLINE# obj2 = jsonex . create_json_response ( obj , None , encoder = _JSONEncoder , status_code = 402 , explanation = 'success' , message = 'foo' , title = 'bar' , body = { #NEWLINE# #INDENT# 'zoo' : 'zoo' , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( obj2 . content_type == 'application/json' ) #NEWLINE# assert isinstance ( obj2 . body , six . binary_type ) #NEWLINE# body = json . loads ( obj2 . body . decode ( 'utf-8' ) ) #NEWLINE# assert ( body == { #NEWLINE# #INDENT# 'zoo' : 'zoo' , #NEWLINE# #UNINDENT# } )