mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[ADD] report_wkhtmltopdf_param
This commit is contained in:
committed by
Jordi Ballester
parent
fd70d2e34c
commit
cc08c2be97
5
report_wkhtmltopdf_param/tests/__init__.py
Normal file
5
report_wkhtmltopdf_param/tests/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2017 Avoin.Systems
|
||||
# Copyright 2017 Eficent Business and IT Consulting Services, S.L.
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
from . import test_report_paperformat
|
||||
31
report_wkhtmltopdf_param/tests/test_report_paperformat.py
Normal file
31
report_wkhtmltopdf_param/tests/test_report_paperformat.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2017 Avoin.Systems
|
||||
# Copyright 2017 Eficent Business and IT Consulting Services, S.L.
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp.tests.common import TransactionCase
|
||||
from openerp.exceptions import ValidationError
|
||||
|
||||
|
||||
class TestWkhtmltopdf(TransactionCase):
|
||||
def test_wkhtmltopdf_incorrect_parameter(self):
|
||||
for report_paperformat in self.env['report.paperformat'].search([]):
|
||||
with self.assertRaises(ValidationError):
|
||||
report_paperformat.update({
|
||||
'custom_params': [(0, 0, {
|
||||
'name': 'bad-parameter'
|
||||
})]})
|
||||
|
||||
def test_wkhtmltopdf_valid_parameter(self):
|
||||
for report_paperformat in self.env['report.paperformat'].search([]):
|
||||
error = False
|
||||
try:
|
||||
report_paperformat.update({
|
||||
'custom_params': [(0, 0, {
|
||||
'name': '--disable-smart-shrinking'
|
||||
})]})
|
||||
except ValidationError:
|
||||
error = True
|
||||
self.assertEquals(error, False,
|
||||
"There was an error adding wkhtmltopdf "
|
||||
"parameter --disable-smart-shrinking")
|
||||
Reference in New Issue
Block a user