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
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
def test_preauthorize_bridge_django_error(): preauth = bridge_oscar.PreauthorizeBridge('1', card=MockCreditCard()) preauthorize_instance = preauth.process() assert preauthorize_instance is None