mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
Add simple tests and fix call to fusion server
This commit is contained in:
committed by
Elmeri Niemelä
parent
61172a42ef
commit
94df910703
27
report_py3o/tests/test_report_py3o.py
Normal file
27
report_py3o/tests/test_report_py3o.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2016 ACSONE SA/NV
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).).
|
||||
|
||||
|
||||
import mock
|
||||
|
||||
from openerp.tests.common import TransactionCase
|
||||
import openerp.tests
|
||||
|
||||
|
||||
@openerp.tests.common.at_install(False)
|
||||
@openerp.tests.common.post_install(True)
|
||||
class TestReportPy3o(TransactionCase):
|
||||
|
||||
def test_reports(self):
|
||||
domain = [('report_type', '=', 'py3o'),
|
||||
('report_name', '=', 'py3o_user_info')]
|
||||
reports = self.env['ir.actions.report.xml'].search(domain)
|
||||
self.assertEqual(1, len(reports))
|
||||
for r in reports:
|
||||
with mock.patch('openerp.addons.report_py3o.py3o_parser.'
|
||||
'Py3oParser.create_single_pdf') as patched_pdf:
|
||||
r.render_report(self.env.user.ids,
|
||||
r.report_name,
|
||||
{})
|
||||
self.assertEqual(1, patched_pdf.call_count)
|
||||
Reference in New Issue
Block a user