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
720 B

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