test: Update tests 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: 56946fac8f/rest_framework/views.py (L456C3-L456C3)
This commit is contained in:
@@ -64,6 +64,10 @@ class ApiTestCase(TestCase):
|
||||
"""Assert that the given response has the status code 201"""
|
||||
assert response.status_code == 201
|
||||
|
||||
def assertHttpNotAuthorized(self, response):
|
||||
"""Assert that the given response has the status code 401"""
|
||||
assert response.status_code == 401
|
||||
|
||||
def assertHttpForbidden(self, response):
|
||||
"""Assert that the given response has the status code 403"""
|
||||
assert response.status_code == 403
|
||||
|
||||
Reference in New Issue
Block a user