#NEWLINE# def testErrorFormat( self ) : #NEWLINE# #INDENT# 'Test that error returned by the service handler is properly formed.' #NEWLINE# ident_dict = { #NEWLINE# #INDENT# 'key' : 'Email:andy@emailscrubbed.com' , #NEWLINE# 'authority' : 'FakeViewfinder' , #NEWLINE# #UNINDENT# } #NEWLINE# auth_info_dict = { #NEWLINE# #INDENT# 'identity' : auth_info_dict [ 'key' ] , #NEWLINE# #UNINDENT# } #NEWLINE# url = self . _tester . GetUrl ( '/login/viewfinder' ) #NEWLINE# request_dict = _CreateRegisterRequest ( self . _mobile_device_dict , auth_info_dict , synchronous = False ) #NEWLINE# response = _SendAuthRequest ( self . _tester , url , 'POST' , request_dict = request_dict , allow_errors = [ 403 ] ) #NEWLINE# self . assertEqual ( json . loads ( response . body ) , { #NEWLINE# #INDENT# 'error' : { #NEWLINE# #INDENT# 'id' : 'NO_USER_ACCOUNT' , #NEWLINE# 'method' : 'login' , #NEWLINE# 'message' : ( "We can't find your Viewfinder account. Are you sure you used " + 'andy@emailscrubbed.com to sign up?' ) , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } )