From 7540d0e94dfa310963168b1d744bd2dbbb7b7ae6 Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Tue, 17 Oct 2023 12:14:37 +0200 Subject: [PATCH 1/3] [IMP] base_bank_from_iban: test performance improvement - Include context keys for avoiding mail operations overhead. --- base_bank_from_iban/tests/test_base_bank_from_iban.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/base_bank_from_iban/tests/test_base_bank_from_iban.py b/base_bank_from_iban/tests/test_base_bank_from_iban.py index 8ec770ef..e40f697b 100644 --- a/base_bank_from_iban/tests/test_base_bank_from_iban.py +++ b/base_bank_from_iban/tests/test_base_bank_from_iban.py @@ -9,6 +9,16 @@ class TestBaseBankFromIban(common.TransactionCase): @classmethod def setUpClass(cls): super(TestBaseBankFromIban, cls).setUpClass() + cls.env = cls.env( + context=dict( + cls.env.context, + mail_create_nolog=True, + mail_create_nosubscribe=True, + mail_notrack=True, + no_reset_password=True, + tracking_disable=True, + ) + ) cls.country_spain = cls.env.ref("base.es") cls.bank = cls.env["res.bank"].create( {"name": "BDE", "code": "9999", "country": cls.country_spain.id} From 5c331e7c8c0e7f2b85dd737d754382e3e4bc0265 Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Tue, 17 Oct 2023 12:16:33 +0200 Subject: [PATCH 2/3] [IMP] base_iso3166: test performance improvement - Create setUpClass method - Include context keys for avoiding mail operations overhead. --- base_iso3166/tests/test_iso3166.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/base_iso3166/tests/test_iso3166.py b/base_iso3166/tests/test_iso3166.py index 510ff5e9..4a7eaa8b 100644 --- a/base_iso3166/tests/test_iso3166.py +++ b/base_iso3166/tests/test_iso3166.py @@ -5,6 +5,20 @@ class TestBaseIso3166(common.TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.env = cls.env( + context=dict( + cls.env.context, + mail_create_nolog=True, + mail_create_nosubscribe=True, + mail_notrack=True, + no_reset_password=True, + tracking_disable=True, + ) + ) + def test_iso_3166(self): country = self.env.ref("base.ad") self.assertEqual(country.code_alpha3, "AND") From 2ec53bf8f2f9c18dd546792609e07a21dfc669cf Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Tue, 17 Oct 2023 12:18:17 +0200 Subject: [PATCH 3/3] [IMP] product_fao_fishing: test performance improvement - Include context keys for avoiding mail operations overhead. --- product_fao_fishing/tests/test_product_fao_fishing.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/product_fao_fishing/tests/test_product_fao_fishing.py b/product_fao_fishing/tests/test_product_fao_fishing.py index c8d5c645..636fe180 100644 --- a/product_fao_fishing/tests/test_product_fao_fishing.py +++ b/product_fao_fishing/tests/test_product_fao_fishing.py @@ -7,6 +7,16 @@ class TestProductFaoFishing(TransactionCase): @classmethod def setUpClass(cls): super().setUpClass() + cls.env = cls.env( + context=dict( + cls.env.context, + mail_create_nolog=True, + mail_create_nosubscribe=True, + mail_notrack=True, + no_reset_password=True, + tracking_disable=True, + ) + ) cls.product_attribute = cls.env.ref("product_fao_fishing.fao_fishing_area") cls.fao_technique_attribute = cls.env.ref( "product_fao_fishing.fao_fishing_technique"