From 6344297a0ec28159633a376f43bbc982050fd591 Mon Sep 17 00:00:00 2001 From: SilvioC2C Date: Fri, 12 Jun 2026 16:57:20 +0200 Subject: [PATCH] [IMP] component: improve test setup Class ``TransactionComponentCase.setUp()`` was not calling ``super()`` because of an inheritance issue: ``odoo.tests.common.TransactionCase.setUp()`` was not calling ``super()`` either. Since the issue has been solved, the test setup can be improved, allowing subclasses that inherit from ``TransactionComponentCase`` to correctly resolve the chain of ``super().setUp()`` calls. --- component/tests/common.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/component/tests/common.py b/component/tests/common.py index 17da7f0f8..504fd52a8 100644 --- a/component/tests/common.py +++ b/component/tests/common.py @@ -72,17 +72,6 @@ def setUpClass(cls): super().setUpClass() cls.setUpComponent() - # pylint: disable=W8106 - def setUp(self): - # resolve an inheritance issue (common.TransactionCase does not call - # super) - common.TransactionCase.setUp(self) - ComponentMixin.setUp(self) - # There's no env on setUpClass of TransactionCase, must do it here. - self.env.context = dict( - self.env.context, components_registry=self._components_registry - ) - class ComponentRegistryCase: """This test case can be used as a base for writings tests on components