예제 #1
0
def test_invoice_get_invoices_with_no_invoice(session):
    """Assert that get_invoices works."""
    payment_account = factory_payment_account()
    payment = factory_payment()
    payment_account.save()
    payment.save()

    invoices = Invoice_service.get_invoices(payment.id, skip_auth_check=True)

    assert invoices is not None
    assert len(invoices.get('items')) == 0
예제 #2
0
def test_invoice_get_invoices(session):
    """Assert that get_invoices works."""
    payment_account = factory_payment_account()
    payment = factory_payment()
    payment_account.save()
    payment.save()
    i = factory_invoice(payment=payment, payment_account=payment_account)
    i.save()

    invoices = Invoice_service.get_invoices(payment.id, skip_auth_check=True)

    assert invoices is not None
    assert len(invoices.get('items')) == 1
    assert not invoices.get('items')[0].get('line_items')