From d3675cddf85cd2f2f82febb7b7c9a242dfebda4e Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Tue, 17 Oct 2023 16:09:50 +0200 Subject: [PATCH 1/3] [IMP] crm_phonecall: test performance improvement - Include context keys for avoiding mail operations overhead. --- crm_phonecall/tests/test_crm_phonecall.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crm_phonecall/tests/test_crm_phonecall.py b/crm_phonecall/tests/test_crm_phonecall.py index 6cb294b4158..843572b202d 100644 --- a/crm_phonecall/tests/test_crm_phonecall.py +++ b/crm_phonecall/tests/test_crm_phonecall.py @@ -11,6 +11,16 @@ class TestCrmPhoneCall(common.SavepointCase): def setUpClass(cls): """Created required data.""" 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.company = cls.env.ref("base.main_company") partner_obj = cls.env["res.partner"] cls.campaign1 = cls.env["utm.campaign"].create({"name": "campaign 1"}) From a82407b000351ac970a174abc16c5cb2b720f791 Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Tue, 17 Oct 2023 16:10:54 +0200 Subject: [PATCH 2/3] [IMP] crm_phonecall_planner: test performance improvement - Include context keys for avoiding mail operations overhead. --- crm_phonecall_planner/tests/test_planner.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crm_phonecall_planner/tests/test_planner.py b/crm_phonecall_planner/tests/test_planner.py index c7632b55b91..82dbdd8ff57 100644 --- a/crm_phonecall_planner/tests/test_planner.py +++ b/crm_phonecall_planner/tests/test_planner.py @@ -15,6 +15,16 @@ class PlannerCase(SavepointCase): @classmethod def setUpClass(cls): super(PlannerCase, 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.mondays = cls.env["resource.calendar"].create( { "name": "mondays", From bc321fcd44cde29df0481517adab44d4c0b37875 Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Tue, 17 Oct 2023 16:11:52 +0200 Subject: [PATCH 3/3] [IMP] crm_project: test performance improvement --- crm_project/tests/test_crm_project.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crm_project/tests/test_crm_project.py b/crm_project/tests/test_crm_project.py index a6e2080d5ef..29ef20f79ba 100644 --- a/crm_project/tests/test_crm_project.py +++ b/crm_project/tests/test_crm_project.py @@ -9,6 +9,16 @@ class TestCrmProject(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, + ) + ) cls.lead = cls.env["crm.lead"].create( { "name": "Test lead",