From bbd3e63b5be8618df9a176a7d49c6164dd28d8e7 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Wed, 26 Jul 2023 16:32:29 -0400 Subject: [PATCH] test: Update a test to the new return code. When including `JwtAuthentication`, the auth_header becomes `JWT realm="api"`. Without it, it is `None`. This changes the behavior of the code in DRF and returns a slightly different auth response. Relevant Code: https://github.com/encode/django-rest-framework/blob/56946fac8f29aa44ce84391f138d63c4c8a2a285/rest_framework/views.py#L456C3-L456C3 --- openedx/core/djangoapps/embargo/tests/test_views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openedx/core/djangoapps/embargo/tests/test_views.py b/openedx/core/djangoapps/embargo/tests/test_views.py index fae484a32d16..1c8ea7268406 100644 --- a/openedx/core/djangoapps/embargo/tests/test_views.py +++ b/openedx/core/djangoapps/embargo/tests/test_views.py @@ -148,7 +148,7 @@ def mock_country(reader, country): def test_course_access_endpoint_with_logged_out_user(self): self.client.logout() response = self.client.get(self.url, data=self.request_data) - assert response.status_code == 403 + assert response.status_code == 401 def test_course_access_endpoint_with_non_staff_user(self): user = UserFactory(is_staff=False)