Skip to content

Commit

Permalink
account_invoice_ubl_peppol: fix tests
Browse files Browse the repository at this point in the history
Closes #864
  • Loading branch information
simahawk committed Nov 21, 2023
1 parent 694dc4b commit 65c83ad
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions account_invoice_ubl_peppol/tests/test_ubl_email_attachment.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
# Copyright 2021 Sunflower IT (<https://sunflowerweb.nl>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo.addons.account_tax_unece.tests.test_account_invoice import TestAccountInvoice
from odoo.addons.account_invoice_ubl.tests.common import TestUblInvoiceCommon


class TestAccountInvoiceUblPeppol(TestAccountInvoice):
class TestAccountInvoiceUblPeppol(TestUblInvoiceCommon):
def test_ubl_generate_peppol(self):
invoice = self.test_only_create_invoice()
invoice = self._create_invoice()
invoice.company_id.xml_format_in_pdf_invoice = "ubl"
version = "2.1"
pdf_file = (
self.env.ref("account.account_invoices")
.with_context(ubl_version=version, force_report_rendering=True)
.render_qweb_pdf(invoice.ids)[0]
)
report = self.env.ref("account.account_invoices")
pdf_file = report.with_context(
ubl_version=version, force_report_rendering=True
)._render_qweb_pdf(invoice.ids)[0]
res = self.env["base.ubl"].get_xml_files_from_pdf(pdf_file)
invoice_filename = invoice.get_ubl_filename(version=version)
self.assertTrue(invoice_filename in res)
Expand Down

0 comments on commit 65c83ad

Please sign in to comment.