[MIG] migrate report_wkhtmltopdf_param to 18.0

This commit is contained in:
Lukas Tran
2024-10-24 17:31:03 +07:00
committed by Lukas Tran
parent dc0e880baf
commit 8e13d2b154
8 changed files with 38 additions and 27 deletions

View File

@@ -2,6 +2,8 @@
# Copyright 2017 Eficent Business and IT Consulting Services, S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
import logging
import odoo.tests
from odoo.exceptions import ValidationError
from odoo.tests.common import tagged
@@ -11,7 +13,10 @@ from odoo.tests.common import tagged
class TestWkhtmltopdf(odoo.tests.TransactionCase):
def test_wkhtmltopdf_incorrect_parameter(self):
for report_paperformat in self.env["report.paperformat"].search([]):
with self.assertRaises(ValidationError):
with (
self.assertRaises(ValidationError),
self.assertLogs(level=logging.WARNING),
):
report_paperformat.update(
{"custom_params": [(0, 0, {"name": "bad-parameter"})]}
)