Skip to content

Commit

Permalink
fixup! rebase and update 8.13.1 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
robrap committed Nov 16, 2023
1 parent 67240bb commit 26cac08
Showing 1 changed file with 1 addition and 5 deletions.
Expand Up @@ -239,15 +239,11 @@ def test_authenticate_with_correct_jwt_cookie_and_django_request(
custom authentication code.
"""
request = RequestFactory().post('/')
request.META[USE_JWT_COOKIE_HEADER] = 'true'
request.COOKIES[jwt_cookie_name()] = self._get_test_jwt_token()

assert JwtAuthentication().authenticate(request)
mock_enforce_csrf.assert_called_with(request)
is_forgiving_jwt_cookies_enabled = get_setting(ENABLE_FORGIVING_JWT_COOKIES)
mock_set_custom_attribute.assert_any_call('is_forgiving_jwt_cookies_enabled', is_forgiving_jwt_cookies_enabled)
if is_forgiving_jwt_cookies_enabled:
mock_set_custom_attribute.assert_any_call('jwt_auth_with_django_request', True)
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')

@mock.patch('edx_rest_framework_extensions.auth.jwt.authentication.set_custom_attribute')
Expand Down

0 comments on commit 26cac08

Please sign in to comment.