#NEWLINE# def test_update_updates_a_paypal_accounts_token( self ) : #NEWLINE# #INDENT# customer_id = Customer . create ( ) . customer . id #NEWLINE# first_token = ( 'paypal-account-' + str ( randint ( 0 , 100000000 ) ) ) #NEWLINE# second_token = ( 'paypal-account-' + str ( randint ( 0 , 100000000 ) ) ) #NEWLINE# first_nonce = TestHelper . nonce_for_paypal_account ( { #NEWLINE# #INDENT# 'consent_code' : 'consent-code' , #NEWLINE# 'token' : first_token , #NEWLINE# #UNINDENT# } ) #NEWLINE# first_result = PaymentMethod . create ( { #NEWLINE# #INDENT# 'payment_method_nonce' : first_nonce , #NEWLINE# 'customer_id' : customer_id , #NEWLINE# #UNINDENT# } ) #NEWLINE# second_nonce = TestHelper . nonce_for_paypal_account ( { #NEWLINE# #INDENT# 'consent_code' : 'consent-code' , #NEWLINE# 'token' : second_token , #NEWLINE# #UNINDENT# } ) #NEWLINE# second_result = PaymentMethod . create ( { #NEWLINE# #INDENT# 'payment_method_nonce' : second_nonce , #NEWLINE# 'customer_id' : customer_id , #NEWLINE# #UNINDENT# } ) #NEWLINE# updated_result = PaymentMethod . update ( first_token , { #NEWLINE# #INDENT# 'token' : second_token , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertTrue ( ( updated_result . is_success == False ) ) #NEWLINE# self . assertTrue ( ( updated_result . errors . deep_errors [ 0 ] . code == '92906' ) )