Skip to content

Commit

Permalink
[IMP] mis_builder: test performance improvement
Browse files Browse the repository at this point in the history
- Create setUpClass method
- Include context keys for avoiding mail operations overhead.
  • Loading branch information
josep-tecnativa committed Oct 20, 2023
1 parent e2b1388 commit a09427e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions mis_builder/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,20 @@ class OdooDocTestCase(BaseCase):

__qualname__ = "doctests for "

@classmethod
def setUpClass(cls):
super().setUpClass()
# Remove this variable in v16 and put instead:
# from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT
DISABLED_MAIL_CONTEXT = {
"tracking_disable": True,
"mail_create_nolog": True,
"mail_create_nosubscribe": True,
"mail_notrack": True,
"no_reset_password": True,
}
cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT))

def __init__(self, test):
self.__test = test
self.__name = test._dt_test.name
Expand Down

0 comments on commit a09427e

Please sign in to comment.