Skip to content

Commit

Permalink
[REF] l10n_it_fatturapa_out: Invoice used in tests is open when valid…
Browse files Browse the repository at this point in the history
…ated
  • Loading branch information
SirTakobi authored and Borruso committed May 4, 2023
1 parent 699465b commit 8ae41d3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
26 changes: 5 additions & 21 deletions l10n_it_fatturapa_out/tests/fatturapa_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,28 +272,12 @@ def getFile(self, filename, module_name=None):
return self.getFilePath(path)

def _create_invoice(self):
return self.invoice_model.create(
{
"name": "Test Invoice",
"journal_id": self.sales_journal.id,
"partner_id": self.res_partner_fatturapa_0.id,
"move_type": "out_invoice",
"invoice_line_ids": [
(
0,
0,
{
"account_id": self.a_sale.id,
"product_id": self.product_product_10.id,
"name": self.product_product_10.name,
"quantity": 1,
"price_unit": 1,
"tax_ids": [(6, 0, {self.tax_22.id})],
},
),
],
}
invoice = self.init_invoice(
"out_invoice",
partner=self.res_partner_fatturapa_0,
products=self.product_product_10,
)
return invoice

def _create_e_invoice(self):
invoice = self._create_invoice()
Expand Down
12 changes: 12 additions & 0 deletions l10n_it_fatturapa_out/tests/test_fatturapa_xml_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,3 +926,15 @@ def test_trasmittente_xml_export(self):
self.set_e_invoice_file_id(attachment, "IT03297040366_00019.xml")
xml_content = base64.decodebytes(attachment.datas)
self.check_content(xml_content, "IT03297040366_00019.xml")

def test_validate_invoice(self):
"""
Check that the invoice used for tests
is posted when validated.
"""
invoice = self._create_invoice()
self.assertEqual(invoice.state, "draft")

invoice.action_post()

self.assertEqual(invoice.state, "posted")

0 comments on commit 8ae41d3

Please sign in to comment.