#NEWLINE# def test_update_creates_a_new_billing_address_by_default( self ) : #NEWLINE# #INDENT# customer_id = Customer . create ( ) . customer . id #NEWLINE# credit_card_result = CreditCard . create ( { #NEWLINE# #INDENT# 'customer_id' : self , #NEWLINE# 'number' : CreditCardNumbers . Visa , #NEWLINE# 'expiration_date' : '05/2012' , #NEWLINE# 'billing_address' : { #NEWLINE# #INDENT# 'street_address' : '123 Nigeria Ave' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# update_result = PaymentMethod . update ( credit_card_result . credit_card . token , { #NEWLINE# #INDENT# 'billing_address' : { #NEWLINE# #INDENT# 'region' : 'IL' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertTrue ( update_result . is_success ) #NEWLINE# updated_credit_card = update_result . payment_method #NEWLINE# self . assertTrue ( ( updated_credit_card . billing_address . region == 'IL' ) ) #NEWLINE# self . assertTrue ( ( updated_credit_card . billing_address . street_address is None ) ) #NEWLINE# self . assertFalse ( ( updated_credit_card . billing_address . id == credit_card_result . credit_card . billing_address . id ) )