#NEWLINE# @ patch ( 'requests.post' ) #NEWLINE# def test_validated_constructor( self , r_post ) : #NEWLINE# #INDENT# 'A validated set of credentials can be reconstructed' #NEWLINE# credentials = PublicCredentials ( consumer_key = 'key' , consumer_secret = 'secret' , oauth_token = 'validated_token' , oauth_token_secret = 'validated_token_secret' , verified = True ) #NEWLINE# self . assertEqual ( credentials . state , { #NEWLINE# #INDENT# 'consumer_key' : 'key' , #NEWLINE# 'consumer_secret' : 'secret' , #NEWLINE# 'oauth_token' : 'validated_token' , #NEWLINE# 'oauth_token_secret' : 'validated_token_secret' , #NEWLINE# 'verified' : True , #NEWLINE# #UNINDENT# } ) #NEWLINE# try : #NEWLINE# #INDENT# credentials . oauth #NEWLINE# #UNINDENT# except XeroNotVerified : #NEWLINE# #INDENT# self . fail ( 'Credentials should have been verified' ) #NEWLINE# #UNINDENT# self . assertFalse ( r_post . called )