示例#1
0
def test_preauthorize_bridge_payment_error():
    preauth = bridge_oscar.PreauthorizeBridge('1', card=MockCreditCard())

    try:
        preauth.process()
    except oscar_exceptions.PaymentError:
        assert True
    else:
        assert False
示例#2
0
def test_preauthorize_bridge_valid():
    preauth = bridge_oscar.PreauthorizeBridge('1', card=MockCreditCard())

    try:
        preauth.process()
    except (oscar_exceptions.GatewayError, oscar_exceptions.PaymentError):
        assert False
    else:
        assert True
示例#3
0
def test_preauthorize_bridge_django_error():
    preauth = bridge_oscar.PreauthorizeBridge('1', card=MockCreditCard())

    preauthorize_instance = preauth.process()

    assert preauthorize_instance is None