|
@ -11,9 +11,19 @@ class TestReportQwebSigner(HttpCase): |
|
|
'name': 'Test partner', |
|
|
'name': 'Test partner', |
|
|
'customer': True, |
|
|
'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): |
|
|
def test_report_qweb_signer(self): |
|
|
self.report.render_qweb_pdf(self.partner.ids) |
|
|
self.report.render_qweb_pdf(self.partner.ids) |
|
|
# Reprint again for taking the PDF from attachment |
|
|
# 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) |
|
|
self.report.render_qweb_pdf(self.partner.ids) |
|
|
|
|
|
num_attachments_after = IrAttachment.search_count(domain) |
|
|
|
|
|
self.assertEqual(num_attachments, num_attachments_after) |