def METHOD_NAME(self):
    invoice = self.test_only_create_invoice()
    if invoice.company_id.xml_format_in_pdf_invoice != "ubl":
        invoice.company_id.xml_format_in_pdf_invoice = "ubl"
    for version in ["2.0", "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]
        )
        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)