Skip to content

Commit

Permalink
Fix test for "Nota de Crédito electrónica MiPyMEs"
Browse files Browse the repository at this point in the history
See: #185
  • Loading branch information
WhyNotHugo committed Jun 21, 2023
1 parent 404164a commit fdef65d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
19 changes: 17 additions & 2 deletions django_afip/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,25 @@ def post(obj: models.Receipt, create, extracted, **kwargs):
class ReceiptFCEAWithVatTaxAndOptionalsFactory(ReceiptFCEAWithVatAndTaxFactory):
"""Receipt FCEA with a valid Vat, Tax and Optionals, ready to validate."""

total_amount = 13_000_000
net_untaxed = 0
net_taxed = 10_000_000

@post_generation
def post(obj: models.Receipt, create, extracted, **kwargs):
VatFactory(vat_type__code=5, receipt=obj)
TaxFactory(tax_type__code=3, receipt=obj)
VatFactory(
vat_type__code=5,
receipt=obj,
base_amount=10_000_000,
amount=2_100_000,
)
TaxFactory(
tax_type__code=3,
receipt=obj,
base_amount=10_000_000,
aliquot=9,
amount=900_000,
)
OptionalFactory(optional_type__code=2101, receipt=obj)
# Value SCA stands for TRANSFERENCIA AL SISTEMA DE CIRCULACION ABIERTA
OptionalFactory(optional_type__code=27, receipt=obj, value="SCA")
Expand Down
3 changes: 1 addition & 2 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ def test_validate_invoice(populated_db):
@pytest.mark.live()
def test_validate_fcea_invoice(populated_db):
"""Test validating valid receipts."""

receipt = ReceiptFCEAWithVatTaxAndOptionalsFactory()
receipt = ReceiptFCEAWithVatTaxAndOptionalsFactory(document_number=20054100605)
errs = receipt.validate()

assert len(errs) == 0
Expand Down

0 comments on commit fdef65d

Please sign in to comment.