#NEWLINE# def test_create_with_invalid_country_codes( self ) : #NEWLINE# #INDENT# customer = Customer . create ( ) . customer #NEWLINE# result = CreditCard . create ( { #NEWLINE# #INDENT# 'customer_id' : result . id , #NEWLINE# 'number' : '4111111111111111' , #NEWLINE# 'expiration_date' : '05/2012' , #NEWLINE# 'billing_address' : { #NEWLINE# #INDENT# 'country_code_alpha2' : 'ZZ' , #NEWLINE# 'country_code_alpha3' : 'ZZZ' , #NEWLINE# 'country_code_numeric' : '000' , #NEWLINE# 'country_name' : 'zzzzzzz' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertFalse ( result . is_success ) #NEWLINE# self . assertEquals ( ErrorCodes . Address . CountryCodeAlpha2IsNotAccepted , result . errors . for_object ( 'credit_card' ) . for_object ( 'billing_address' ) . on ( 'country_code_alpha2' ) [ 0 ] . code ) #NEWLINE# self . assertEquals ( ErrorCodes . Address . CountryCodeAlpha3IsNotAccepted , result . errors . for_object ( 'credit_card' ) . for_object ( 'billing_address' ) . on ( 'country_code_alpha3' ) [ 0 ] . code ) #NEWLINE# self . assertEquals ( ErrorCodes . Address . CountryCodeNumericIsNotAccepted , result . errors . for_object ( 'credit_card' ) . for_object ( 'billing_address' ) . on ( 'country_code_numeric' ) [ 0 ] . code ) #NEWLINE# self . assertEquals ( ErrorCodes . Address . CountryNameIsNotAccepted , result . errors . for_object ( 'credit_card' ) . for_object ( 'billing_address' ) . on ( 'country_name' ) [ 0 ] . code )