From 6e462b2b7f0385b277992b6005d7deb452db0351 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 16 May 2019 13:27:56 +0200 Subject: [PATCH] [MIG] report_qweb_signer: Refine migration - Good dependency chain - Context for forcing rendering PDF - Extra test --- report_qweb_signer/__manifest__.py | 2 +- report_qweb_signer/tests/test_report_qweb_signer.py | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/report_qweb_signer/__manifest__.py b/report_qweb_signer/__manifest__.py index 6a4cae94..ab6585e3 100644 --- a/report_qweb_signer/__manifest__.py +++ b/report_qweb_signer/__manifest__.py @@ -14,7 +14,7 @@ "license": "AGPL-3", "installable": True, "depends": [ - "web", + "web_editor", ], "external_dependencies": { "bin": ['/usr/bin/java'], diff --git a/report_qweb_signer/tests/test_report_qweb_signer.py b/report_qweb_signer/tests/test_report_qweb_signer.py index 7c09b18b..54eb7f7a 100644 --- a/report_qweb_signer/tests/test_report_qweb_signer.py +++ b/report_qweb_signer/tests/test_report_qweb_signer.py @@ -11,9 +11,19 @@ class TestReportQwebSigner(HttpCase): 'name': 'Test partner', 'customer': True, }) - self.report = self.env.ref('report_qweb_signer.partner_demo_report') + self.report = self.env.ref( + 'report_qweb_signer.partner_demo_report' + ).with_context(force_report_rendering=True) def test_report_qweb_signer(self): self.report.render_qweb_pdf(self.partner.ids) # Reprint again for taking the PDF from attachment + IrAttachment = self.env['ir.attachment'] + domain = [ + ('res_id', '=', self.partner.id), + ('res_model', '=', self.partner._name), + ] + num_attachments = IrAttachment.search_count(domain) self.report.render_qweb_pdf(self.partner.ids) + num_attachments_after = IrAttachment.search_count(domain) + self.assertEqual(num_attachments, num_attachments_after)