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.

28 lines
888 B

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. # Copyright 2009-2019 Noviat.
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  3. from datetime import date
  4. from odoo.tests.common import TransactionCase
  5. class TestReportXlsxHelper(TransactionCase):
  6. def setUp(self):
  7. super(TestReportXlsxHelper, self).setUp()
  8. today = date.today()
  9. p1 = self.env.ref('base.res_partner_1')
  10. p2 = self.env.ref('base.res_partner_2')
  11. p1.date = today
  12. p2.date = today
  13. self.partners = p1 + p2
  14. ctx = {
  15. 'report_name': 'report_xlsx_helper.test_partner_xlsx',
  16. 'active_model': 'res.partner',
  17. 'active_ids': self.partners.ids,
  18. }
  19. self.report = self.env['ir.actions.report'].with_context(ctx)
  20. def test_report_xlsx_helper(self):
  21. report_xls = self.report.render_xlsx(None, None)
  22. self.assertEqual(report_xls[1], 'xlsx')