From 9eaecfa062a0303649513648c70c06ff32e0ee88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Todorovich?= Date: Thu, 28 Dec 2023 15:15:32 -0300 Subject: [PATCH] [FIX] base: skip pdf rendering tests if pdfminer is not installed The unit tests introduced in 4820be3c only work if pdfminer is installed. As it's an optional dependency, it may not be installed in some environments. This commit skips the tests if pdfminer is not installed. See also: 6fa4dbf2 closes odoo/odoo#147720 Signed-off-by: Xavier Morel (xmo) --- odoo/addons/base/tests/test_reports.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/odoo/addons/base/tests/test_reports.py b/odoo/addons/base/tests/test_reports.py index 7e9f5376b85..eb8f682e415 100644 --- a/odoo/addons/base/tests/test_reports.py +++ b/odoo/addons/base/tests/test_reports.py @@ -3,6 +3,7 @@ import io import logging from base64 import b64decode +from unittest import skipIf import odoo import odoo.tests @@ -171,6 +172,7 @@ class Box: return (self.y1, self.x1, self.y2, self.x2) < (other.y1, other.x1, other.y2, other.x2) +@skipIf(pdfminer is False, "pdfminer not installed") class TestReportsRenderingCommon(odoo.tests.HttpCase): def setUp(self):