From 2e7a3a9ec64b369944a10db31bb65d3b9e04908f Mon Sep 17 00:00:00 2001 From: David Date: Fri, 13 Dec 2024 11:45:34 +0100 Subject: [PATCH] [FIX] mis_builder: ensure ci Some modules could insert data to the default company that could make the tests checks fail. With this patch we ensure, at least for this test cases to be performed with a brand new company. --- mis_builder/tests/test_data_sources.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mis_builder/tests/test_data_sources.py b/mis_builder/tests/test_data_sources.py index e6f2231d6..deebc9046 100644 --- a/mis_builder/tests/test_data_sources.py +++ b/mis_builder/tests/test_data_sources.py @@ -35,6 +35,14 @@ def _create_move(self, date, amount, debit_acc, credit_acc): move._post() return move + @classmethod + def setUpClass(cls): + super().setUpClass() + # Perform the tests with a brand new company to avoid intrusive data from other + # modules added to the default company + cls.company = cls.env["res.company"].create({"name": "Company Test"}) + cls.env.user.company_id = cls.company + def setUp(self): super().setUp() self.account_model = self.env["account.account"]