<s> from tests . test_helper import * <EOL> from braintree . test . nonces import Nonces <EOL> class TestMerchantGateway ( unittest . TestCase ) : <EOL> def test_create_merchant ( self ) : <EOL> gateway = BraintreeGateway ( <EOL> client_id = "<STR_LIT>" , <EOL> client_secret = "<STR_LIT>" , <EOL> environment = Environment . Development <EOL> ) <EOL> result = gateway . merchant . create ( { <EOL> "<STR_LIT:email>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : [ "<STR_LIT>" , "<STR_LIT>" ] <EOL> } ) <EOL> merchant = result . merchant <EOL> self . assertIsNotNone ( merchant . id ) <EOL> self . assertEquals ( merchant . email , "<STR_LIT>" ) <EOL> self . assertEquals ( merchant . country_code_alpha3 , "<STR_LIT>" ) <EOL> self . assertEquals ( merchant . country_code_alpha2 , "<STR_LIT>" ) <EOL> self . assertEquals ( merchant . country_code_numeric , "<STR_LIT>" ) <EOL> self . assertEquals ( merchant . country_name , "<STR_LIT>" ) <EOL> self . assertEquals ( merchant . company_name , "<STR_LIT>" ) <EOL> self . assertTrue ( result . is_success ) <EOL> credentials = result . credentials <EOL> self . assertIsNotNone ( credentials . access_token ) <EOL> self . assertIsNotNone ( credentials . expires_at ) <EOL> self . assertEquals ( "<STR_LIT>" , credentials . token_type ) <EOL> def test_returns_error_with_invalid_payment_methods ( self ) : <EOL> gateway = BraintreeGateway ( <EOL> client_id = "<STR_LIT>" , <EOL> client_secret = "<STR_LIT>" , <EOL> environment = Environment . Development <EOL> ) <EOL> result = gateway . merchant . create ( { <EOL> "<STR_LIT:email>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : [ "<STR_LIT>" ] <EOL> } ) <EOL> self . assertFalse ( result . is_success ) <EOL> self . assertEqual ( <EOL> result . errors . for_object ( "<STR_LIT>" ) . on ( "<STR_LIT>" ) [ <NUM_LIT:0> ] . code , <EOL> ErrorCodes . Merchant . PaymentMethodsAreInvalid <EOL> ) <EOL> self . assertIn ( "<STR_LIT>" , result . message ) </s>
