Fix #60 se extendiente tipo de operacion a otros documentos.

FossilOrigin-Name: 299c70b2dc438aa24b00bdd015144404be425b6bb0afecf8d31ba68d48928e78
This commit is contained in:
2020-11-01 01:57:58 +00:00
parent b024533934
commit 48908a597d
4 changed files with 53 additions and 3 deletions

View File

@@ -93,3 +93,42 @@ def test_FAU14():
wants = form.Amount(119.0 + 19.0 - 50.0)
assert inv.invoice_legal_monetary_total.payable_amount == wants, "got %s want %s" % (inv.invoice_legal_monetary_total.payable_amount, wants)
def test_invalid_tipo_operacion_nota_debito():
reference = form.InvoiceDocumentReference(
ident = '11111',
uuid = '21312312',
date = '2020-05-05'
)
inv = form.DebitNote(reference)
with pytest.raises(ValueError):
inv.set_operation_type(22)
def test_valid_tipo_operacion_nota_debito():
reference = form.InvoiceDocumentReference(
ident = '11111',
uuid = '21312312',
date = '2020-05-05'
)
inv = form.DebitNote(reference)
inv.set_operation_type('30')
def test_invalid_tipo_operacion_nota_credito():
reference = form.InvoiceDocumentReference(
ident = '11111',
uuid = '21312312',
date = '2020-05-05'
)
inv = form.DebitNote(reference)
with pytest.raises(ValueError):
inv.set_operation_type('990')
def test_valid_tipo_operacion_nota_credito():
reference = form.InvoiceDocumentReference(
ident = '11111',
uuid = '21312312',
date = '2020-05-05'
)
inv = form.CreditNote(reference)
inv.set_operation_type('20')