mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[IMP] report_wkhtmltopdf_param: black, isort, prettier
This commit is contained in:
@@ -10,23 +10,24 @@ from odoo.exceptions import ValidationError
|
||||
@odoo.tests.common.post_install(True)
|
||||
class TestWkhtmltopdf(odoo.tests.TransactionCase):
|
||||
def test_wkhtmltopdf_incorrect_parameter(self):
|
||||
for report_paperformat in self.env['report.paperformat'].search([]):
|
||||
for report_paperformat in self.env["report.paperformat"].search([]):
|
||||
with self.assertRaises(ValidationError):
|
||||
report_paperformat.update({
|
||||
'custom_params': [(0, 0, {
|
||||
'name': 'bad-parameter'
|
||||
})]})
|
||||
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([]):
|
||||
for report_paperformat in self.env["report.paperformat"].search([]):
|
||||
error = False
|
||||
try:
|
||||
report_paperformat.update({
|
||||
'custom_params': [(0, 0, {
|
||||
'name': '--disable-smart-shrinking'
|
||||
})]})
|
||||
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")
|
||||
self.assertEquals(
|
||||
error,
|
||||
False,
|
||||
"There was an error adding wkhtmltopdf "
|
||||
"parameter --disable-smart-shrinking",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user