diff --git a/auth_jwt/models/auth_jwt_validator.py b/auth_jwt/models/auth_jwt_validator.py index 13649adad2..73bc8a393b 100644 --- a/auth_jwt/models/auth_jwt_validator.py +++ b/auth_jwt/models/auth_jwt_validator.py @@ -13,6 +13,7 @@ from odoo import _, api, fields, models, tools from odoo.exceptions import ValidationError +from odoo.tools import mute_logger from ..exceptions import ( AmbiguousJwtValidator, @@ -251,19 +252,21 @@ def _register_hook(self): def _register_auth_method(self): IrHttp = self.env["ir.http"] - for rec in self: - setattr( - IrHttp.__class__, - f"_auth_method_jwt_{rec.name}", - partial(IrHttp.__class__._auth_method_jwt, validator_name=rec.name), - ) - setattr( - IrHttp.__class__, - f"_auth_method_public_or_jwt_{rec.name}", - partial( - IrHttp.__class__._auth_method_public_or_jwt, validator_name=rec.name - ), - ) + with mute_logger("odoo.tests.common"): # Mute patch checker during tests + for rec in self: + setattr( + IrHttp.__class__, + f"_auth_method_jwt_{rec.name}", + partial(IrHttp.__class__._auth_method_jwt, validator_name=rec.name), + ) + setattr( + IrHttp.__class__, + f"_auth_method_public_or_jwt_{rec.name}", + partial( + IrHttp.__class__._auth_method_public_or_jwt, + validator_name=rec.name, + ), + ) def _unregister_auth_method(self): IrHttp = self.env["ir.http"]