diff --git a/account_invoice_ubl_peppol/tests/test_ubl_email_attachment.py b/account_invoice_ubl_peppol/tests/test_ubl_email_attachment.py index 88c64edf782..4a5f9c73d17 100644 --- a/account_invoice_ubl_peppol/tests/test_ubl_email_attachment.py +++ b/account_invoice_ubl_peppol/tests/test_ubl_email_attachment.py @@ -1,19 +1,18 @@ # Copyright 2021 Sunflower IT () # 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)