Beispiel #1
0
def test_invalid_iban():
    payment = Payment(debtor=biz_with_cuc, account='ITINVALIDIBAN')
    with pytest.raises(InvalidIBANError):
        payment.xml()

    payment.account = 'XXINVALIDIBAN'
    payment.abi = '01234'
    with pytest.raises(InvalidIBANError):
        payment.xml()

    payment.account = acct_37.replace('IT37', 'IT99')
    with pytest.raises(InvalidIBANError):
        payment.xml()
Beispiel #2
0
def test_invalid_iban():
    payment = Payment(debtor=biz_with_cuc, account='ITINVALIDIBAN')
    with pytest.raises(InvalidIBANError):
        payment.xml()

    payment.account = 'XXINVALIDIBAN'
    payment.abi = '01234'
    with pytest.raises(InvalidIBANError):
        payment.xml()

    payment.account = acct_37.replace('IT37', 'IT99')
    with pytest.raises(InvalidIBANError):
        payment.xml()
Beispiel #3
0
def test_missing_attrs_payment():
    "Payments must always have a `debtor` and an `account` attribute."
    payment = Payment()
    with pytest.raises(AttributeError):
        payment.xml()

    payment.debtor = biz_with_cuc
    with pytest.raises(AttributeError):
        payment.xml()

    payment.account = acct_37

    # No exception must be raised
    payment.add_transaction(amount=1, account=acct_86,
                            rmtinfo='Test', creditor=biz)
    payment.xml()
Beispiel #4
0
def test_missing_attrs_payment():
    "Payments must always have a `debtor` and an `account` attribute."
    payment = Payment()
    with pytest.raises(AttributeError):
        payment.xml()

    payment.debtor = biz_with_cuc
    with pytest.raises(AttributeError):
        payment.xml()

    payment.account = acct_37

    # No exception must be raised
    payment.add_transaction(amount=1,
                            account=acct_86,
                            rmtinfo='Test',
                            creditor=biz)
    payment.xml()