#NEWLINE# @ testing . gen_test #NEWLINE# def test_handles_invalid_json( self ) : #NEWLINE# #INDENT# with pytest . raises ( httpclient . HTTPError ) as exc : #NEWLINE# #INDENT# ( yield self . http_client . fetch ( self . get_url ( '/resources/jernk/providers/jaaaaank/' ) , method = 'POST' , body = '<XML4LYFE/>' ) ) #NEWLINE# #UNINDENT# assert ( exc . value . code == client . BAD_REQUEST )