Example #1
0
def test_get_braintree_gateway(gateway_config):
    result = get_braintree_gateway(**gateway_config)
    assert gateway_config['sandbox_mode'] == False
    assert result.config.environment == Environment.Production
    assert result.config.merchant_id == gateway_config['merchant_id']
    assert result.config.public_key == gateway_config['public_key']
    assert result.config.private_key == gateway_config['private_key']
Example #2
0
def test_get_braintree_gateway(gateway_config):
    result = get_braintree_gateway(**gateway_config)
    assert gateway_config['sandbox_mode'] == False
    assert result.config.environment == Environment.Production
    assert result.config.merchant_id == gateway_config['merchant_id']
    assert result.config.public_key == gateway_config['public_key']
    assert result.config.private_key == gateway_config['private_key']
def test_get_braintree_gateway(gateway_config):
    result = get_braintree_gateway(**gateway_config)
    assert gateway_config["sandbox_mode"] is False
    assert result.config.environment == Environment.Production
    assert result.config.merchant_id == gateway_config["merchant_id"]
    assert result.config.public_key == gateway_config["public_key"]
    assert result.config.private_key == gateway_config["private_key"]
Example #4
0
def test_get_braintree_gateway(gateway_config):
    connection_params = gateway_config.connection_params
    result = get_braintree_gateway(**gateway_config.connection_params)
    assert connection_params["sandbox_mode"] is False
    assert result.config.environment == Environment.Production
    assert result.config.merchant_id == connection_params["merchant_id"]
    assert result.config.public_key == connection_params["public_key"]
    assert result.config.private_key == connection_params["private_key"]
Example #5
0
def test_get_braintree_gateway_inproperly_configured(gateway_config):
    with pytest.raises(ImproperlyConfigured):
        gateway_config.connection_params["private_key"] = None
        get_braintree_gateway(**gateway_config.connection_params)
Example #6
0
def test_get_braintree_gateway_sandbox(gateway_config):
    gateway_config.connection_params["sandbox_mode"] = True
    result = get_braintree_gateway(**gateway_config.connection_params)
    assert result.config.environment == Environment.Sandbox
Example #7
0
def test_get_braintree_gateway_inproperly_configured(gateway_config):
    with pytest.raises(ImproperlyConfigured):
        gateway_config['private_key'] = None
        get_braintree_gateway(**gateway_config)
Example #8
0
def test_get_braintree_gateway_sandbox(gateway_config):
    gateway_config['sandbox_mode'] = True
    result = get_braintree_gateway(**gateway_config)
    assert result.config.environment == Environment.Sandbox
Example #9
0
def test_get_braintree_gateway_inproperly_configured(gateway_config):
    with pytest.raises(ImproperlyConfigured):
        gateway_config['private_key'] = None
        get_braintree_gateway(**gateway_config)
Example #10
0
def test_get_braintree_gateway_sandbox(gateway_config):
    gateway_config['sandbox_mode'] = True
    result = get_braintree_gateway(**gateway_config)
    assert result.config.environment == Environment.Sandbox
Example #11
0
def test_get_braintree_gateway_inproperly_configured(gateway_config):
    with pytest.raises(ImproperlyConfigured):
        gateway_config.connection_params["private_key"] = None
        get_braintree_gateway(**gateway_config.connection_params)
Example #12
0
def test_get_braintree_gateway_sandbox(gateway_config):
    gateway_config.connection_params["sandbox_mode"] = True
    result = get_braintree_gateway(**gateway_config.connection_params)
    assert result.config.environment == Environment.Sandbox