Skip to content

Commit

Permalink
[IMP] crm_phonecall: test performance improvement
Browse files Browse the repository at this point in the history
- Include context keys for avoiding mail operations overhead.
  • Loading branch information
josep-tecnativa committed Oct 17, 2023
1 parent e9e0a40 commit d3675cd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crm_phonecall/tests/test_crm_phonecall.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ class TestCrmPhoneCall(common.SavepointCase):
def setUpClass(cls):
"""Created required data."""
super().setUpClass()
cls.env = cls.env(

This comment has been minimized.

Copy link
@josep-tecnativa

josep-tecnativa Oct 20, 2023

Author Contributor

In 16.0, use cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT)) inestead. And add this import:
from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT

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"})
Expand Down

0 comments on commit d3675cd

Please sign in to comment.