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.

27 lines
944 B

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2016 ACSONE SA/NV
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).).
  4. import mock
  5. from openerp.tests.common import TransactionCase
  6. import openerp.tests
  7. @openerp.tests.common.at_install(False)
  8. @openerp.tests.common.post_install(True)
  9. class TestReportPy3o(TransactionCase):
  10. def test_reports(self):
  11. report = self.env.ref("report_py3o.res_users_report_py3o")
  12. with mock.patch('openerp.addons.report_py3o.py3o_parser.'
  13. 'Py3oParser.create_single_pdf') as patched_pdf:
  14. # test the call the the create method inside our custom parser
  15. report.render_report(self.env.user.ids,
  16. report.report_name,
  17. {})
  18. self.assertEqual(1, patched_pdf.call_count)
  19. res = report.render_report(
  20. self.env.user.ids, report.report_name, {})
  21. self.assertTrue(res)