#NEWLINE# def test_echange_token_failure( self ) : #NEWLINE# #INDENT# client_id = 8998879 #NEWLINE# client_secret = 'iou0q9wud0q9wd0q9wid0q9iwd0q9wid0q9wdqwd' #NEWLINE# redirect_uri = 'http://example.com/auth' #NEWLINE# code = 'invalidcode' #NEWLINE# self . cs = CreateSend ( self . oauth_auth_details ) #NEWLINE# self . cs . stub_request ( 'https://api.createsend.com/oauth/token' , 'oauth_exchange_token_error.json' ) #NEWLINE# self . assertRaises ( Exception , self . cs . exchange_token , client_id , client_secret , redirect_uri , code ) #NEWLINE# self . assertEquals ( self . cs . faker . actual_body , 'grant_type=authorization_code&client_id=8998879&client_secret=iou0q9wud0q9wd0q9wid0q9iwd0q9wid0q9wdqwd&redirect_uri=http%3A%2F%2Fexample.com%2Fauth&code=invalidcode' )