#NEWLINE# def test_exchange_token_success( self ) : #NEWLINE# #INDENT# client_id = 8998879 #NEWLINE# client_secret = 'iou0q9wud0q9wd0q9wid0q9iwd0q9wid0q9wdqwd' #NEWLINE# redirect_uri = 'http://example.com/auth' #NEWLINE# code = '98uqw9d8qu9wdu' #NEWLINE# self . cs = CreateSend ( self . oauth_auth_details ) #NEWLINE# self . cs . stub_request ( 'https://api.createsend.com/oauth/token' , 'oauth_exchange_token.json' ) #NEWLINE# ( access_token , expires_in , refresh_token ) = self . cs . exchange_token ( client_id = client_id , client_secret = client_secret , redirect_uri = redirect_uri , code = 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=98uqw9d8qu9wdu' ) #NEWLINE# self . assertEquals ( access_token , 'SlAV32hkKG' ) #NEWLINE# self . assertEquals ( expires_in , 1209600 ) #NEWLINE# self . assertEquals ( refresh_token , 'tGzv3JOkF0XG5Qx2TlKWIA' )