From 9f527ca6a1640f9cdfe7ea1a5c19b6a2d04e5b87 Mon Sep 17 00:00:00 2001 From: Syed Sajjad Hussain Shah Date: Wed, 20 Dec 2023 17:43:51 +0500 Subject: [PATCH] feat: add check for enforcing jwt and lms user email match --- .../auth/jwt/tests/test_authentication.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/edx_rest_framework_extensions/auth/jwt/tests/test_authentication.py b/edx_rest_framework_extensions/auth/jwt/tests/test_authentication.py index 2adaee8a..c50800f1 100644 --- a/edx_rest_framework_extensions/auth/jwt/tests/test_authentication.py +++ b/edx_rest_framework_extensions/auth/jwt/tests/test_authentication.py @@ -251,6 +251,11 @@ def test_authenticate_with_correct_jwt_cookie_and_django_request( mock_set_custom_attribute.assert_any_call('jwt_auth_with_django_request', True) mock_set_custom_attribute.assert_any_call('jwt_auth_result', 'success-cookie') + @override_settings( + EDX_DRF_EXTENSIONS={ + ENABLE_JWT_AND_LMS_USER_EMAIL_MATCH: False + } + ) @mock.patch('edx_rest_framework_extensions.auth.jwt.authentication.set_custom_attribute') def test_authenticate_csrf_protected(self, mock_set_custom_attribute): """