From c62745643c30056fc2106ea67e6441209ae3c52a Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Tue, 24 Oct 2023 16:22:17 +0200 Subject: [PATCH] [IMP] auth_oauth_multi_token: test performance improvement - Include context keys for avoiding mail operations overhead. --- auth_oauth_multi_token/tests/test_multi_token.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/auth_oauth_multi_token/tests/test_multi_token.py b/auth_oauth_multi_token/tests/test_multi_token.py index da1ca113d7..0a6fad6eda 100644 --- a/auth_oauth_multi_token/tests/test_multi_token.py +++ b/auth_oauth_multi_token/tests/test_multi_token.py @@ -11,6 +11,16 @@ class TestMultiToken(TransactionCase): @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)) cls.token_model = cls.env["auth.oauth.multi.token"] cls.provider_google = cls.env.ref("auth_oauth.provider_google") cls.user_model = cls.env["res.users"].with_context(