Skip to content

Commit

Permalink
test: Update a test to the new return code.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
feanil committed Jul 26, 2023
1 parent f2a61dc commit bbd3e63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/embargo/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bbd3e63

Please sign in to comment.