mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[MIG] report_xml: Migration to 10.0
This commit is contained in:
24
report_xml/tests/test_report_xml.py
Normal file
24
report_xml/tests/test_report_xml.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2017 Creu Blanca
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from lxml import etree
|
||||
from odoo.tests import common
|
||||
|
||||
|
||||
class TestXmlReport(common.TransactionCase):
|
||||
def test_xml(self):
|
||||
report_object = self.env['ir.actions.report.xml']
|
||||
report_name = 'report_xml.demo_report_xml_view'
|
||||
self.assertEqual(
|
||||
report_name, report_object._lookup_report(report_name))
|
||||
docs = self.env['res.company'].search([], limit=1)
|
||||
rep = report_object.render_report(
|
||||
docs.ids, report_name, {}
|
||||
)
|
||||
root = etree.fromstring(rep[0])
|
||||
el = root.xpath('/root/user/name')
|
||||
self.assertEqual(
|
||||
el[0].text,
|
||||
docs.ensure_one().name
|
||||
)
|
||||
Reference in New Issue
Block a user