OCA reporting engine fork for dev and update.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
731 B

  1. # Copyright 2017 Creu Blanca
  2. # License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl).
  3. from lxml import etree
  4. from odoo.tests import common
  5. class TestXmlReport(common.TransactionCase):
  6. def test_xml(self):
  7. report_object = self.env["ir.actions.report"]
  8. report_name = "report_xml.demo_report_xml_view"
  9. report = report_object._get_report_from_name(report_name)
  10. docs = self.env["res.company"].search([], limit=1)
  11. self.assertEqual(report.report_type, "qweb-xml")
  12. result_report = report.render(docs.ids, {})
  13. result_tree = etree.fromstring(result_report[0])
  14. el = result_tree.xpath("/root/user/name")
  15. self.assertEqual(el[0].text, docs.ensure_one().name)