#NEWLINE# def test_require_json_strange_body( self ) : #NEWLINE# #INDENT# req = HttpRequest ( ) #NEWLINE# req . _body = { 'youhou' } #NEWLINE# resp = view_json ( req ) #NEWLINE# self . assertEqual ( resp . status_code , 400 ) #NEWLINE# self . assertEqual ( json . loads ( resp . content ) , { #NEWLINE# #INDENT# 'error' : 'JSON body required.' , #NEWLINE# #UNINDENT# } )