#NEWLINE# def test_create_with_fake_amex_express_checkout_card_nonce( self ) : #NEWLINE# #INDENT# customer_id = Customer . create ( ) . customer . id #NEWLINE# result = PaymentMethod . create ( { #NEWLINE# #INDENT# 'customer_id' : customer_id , #NEWLINE# 'payment_method_nonce' : Nonces . AmexExpressCheckoutCard , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertTrue ( result . is_success ) #NEWLINE# amex_express_checkout_card = result . payment_method #NEWLINE# self . assertIsInstance ( self , AmexExpressCheckoutCard ) #NEWLINE# self . assertNotEqual ( amex_express_checkout_card . token , None ) #NEWLINE# self . assertTrue ( amex_express_checkout_card . default ) #NEWLINE# self . assertEqual ( amex_express_checkout_card . card_type , 'American Express' ) #NEWLINE# self . assertRegexpMatches ( amex_express_checkout_card . bin , '\\A\\d{6}\\Z' ) #NEWLINE# self . assertRegexpMatches ( amex_express_checkout_card . expiration_month , '\\A\\d{2}\\Z' ) #NEWLINE# self . assertRegexpMatches ( amex_express_checkout_card . expiration_year , '\\A\\d{4}\\Z' ) #NEWLINE# self . assertRegexpMatches ( amex_express_checkout_card . card_member_number , '\\A\\d{4}\\Z' ) #NEWLINE# self . assertRegexpMatches ( amex_express_checkout_card . card_member_expiry_date , '\\A\\d{2}/\\d{2}\\Z' ) #NEWLINE# self . assertRegexpMatches ( amex_express_checkout_card . source_description , '\\AAmEx \\d{4}\\Z' ) #NEWLINE# self . assertRegexpMatches ( amex_express_checkout_card . image_url , '\\.png' ) #NEWLINE# self . assertEqual ( amex_express_checkout_card . customer_id , customer_id )