[IMP] report_xml: black, isort

This commit is contained in:
Tatiana Deribina
2019-12-20 13:53:40 +02:00
committed by Enric Tobella
parent fec3d83024
commit e2869482c9
5 changed files with 65 additions and 66 deletions

View File

@@ -2,17 +2,18 @@
# License AGPL-3.0 or later (https://www.gnuorg/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']
report_name = 'report_xml.demo_report_xml_view'
report_object = self.env["ir.actions.report"]
report_name = "report_xml.demo_report_xml_view"
report = report_object._get_report_from_name(report_name)
docs = self.env['res.company'].search([], limit=1)
self.assertEqual(report.report_type, 'qweb-xml')
docs = self.env["res.company"].search([], limit=1)
self.assertEqual(report.report_type, "qweb-xml")
rep = report.render(docs.ids, {})
root = etree.fromstring(rep[0])
el = root.xpath('/root/user/name')
el = root.xpath("/root/user/name")
self.assertEqual(el[0].text, docs.ensure_one().name)