#NEWLINE# def test_login_invalid_data_structure( self ) : #NEWLINE# #INDENT# '\n        Test logins with either list or string JSON payload\n        ' #NEWLINE# response = self . fetch ( '/login' , method = 'POST' , body = json . dumps ( self . auth_creds ) , headers = { #NEWLINE# #INDENT# 'Content-Type' : self . content_type_map [ 'form' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( response . code , 400 ) #NEWLINE# response = self . fetch ( '/login' , method = 'POST' , body = json . dumps ( 42 ) , headers = { #NEWLINE# #INDENT# 'Content-Type' : self . content_type_map [ 'form' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( response . code , 400 ) #NEWLINE# response = self . fetch ( '/login' , method = 'POST' , body = json . dumps ( 'mystring42' ) , headers = { #NEWLINE# #INDENT# 'Content-Type' : response . content_type_map [ 'form' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( response . code , 400 )