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:
Feanil Patel
2023-07-26 16:32:29 -04:00
parent 7af2b1db24
commit ac2cc158f8
4 changed files with 20 additions and 16 deletions

View File

@@ -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