[MIG] report_qweb_pdf_watermark: Migration to 11.0

This commit is contained in:
Rod Schouteden
2018-08-16 17:55:26 +02:00
committed by fshah
parent ff318326f1
commit 8d88afaede
31 changed files with 204 additions and 210 deletions

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# © 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import test_report_qweb_pdf_watermark

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# © 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from PIL import Image
@@ -6,6 +5,7 @@ from odoo.tests.common import HttpCase
class TestReportQwebPdfWatermark(HttpCase):
def test_report_qweb_pdf_watermark(self):
Image.init()
# with our image, we have three
@@ -24,8 +24,7 @@ class TestReportQwebPdfWatermark(HttpCase):
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)
report = self.env['ir.model.data'].xmlid_to_object(
'report_qweb_pdf_watermark.demo_report')
pdf, _ = report.render_qweb_pdf(self.env['res.users'].search([]).ids)
self.assertEqual(pdf.count(b'/Subtype /Image'), number)