#NEWLINE# def test_update_and_make_default( self ) : #NEWLINE# #INDENT# customer = Customer . create ( ) . customer #NEWLINE# card1 = CreditCard . create ( { #NEWLINE# #INDENT# 'customer_id' : customer . id , #NEWLINE# 'number' : '4111111111111111' , #NEWLINE# 'expiration_date' : '05/2014' , #NEWLINE# 'cvv' : '100' , #NEWLINE# 'cardholder_name' : 'John Doe' , #NEWLINE# #UNINDENT# } ) . credit_card #NEWLINE# card2 = CreditCard . create ( { #NEWLINE# #INDENT# 'customer_id' : customer . id , #NEWLINE# 'number' : '4111111111111111' , #NEWLINE# 'expiration_date' : '05/2014' , #NEWLINE# 'cvv' : '100' , #NEWLINE# 'cardholder_name' : 'John Doe' , #NEWLINE# #UNINDENT# } ) . credit_card #NEWLINE# self . assertTrue ( card1 . default ) #NEWLINE# self . assertFalse ( card2 . default ) #NEWLINE# result = CreditCard . update ( card2 . token , { #NEWLINE# #INDENT# 'options' : { #NEWLINE# #INDENT# 'make_default' : True , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertFalse ( CreditCard . find ( card1 . token ) . default ) #NEWLINE# self . assertTrue ( CreditCard . find ( card2 . token ) . default )