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.
|
|
# -*- coding: utf-8 -*- # © 2016 Therp BV <http://therp.nl> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp.tests.common import TransactionCase
class TestReportQwebPdfWatermark(TransactionCase): def test_report_qweb_pdf_watermark(self): # with our image, we have three self._test_report_images(3)
self.env.ref('report_qweb_pdf_watermark.demo_report').write({ 'pdf_watermark_expression': False, }) # without, we have two self._test_report_images(2)
self.env.ref('report_qweb_pdf_watermark.demo_report').write({ 'pdf_watermark': self.env.user.company_id.logo, }) # and now we should have three again self._test_report_images(3)
def _test_report_images(self, number): pdf = self.env['report'].get_pdf( self.env['res.users'].search([]).ids, 'report_qweb_pdf_watermark.demo_report_view', ) self.assertEqual(pdf.count('/Subtype /Image'), number)
|