我正在用Django编写针对用户授权的测试。我收到AssertionError:403!= 401
def test_authorization_is_enforced(self):
"""Test that the api has user authorization."""
new_client = APIClient()
res = new_client.get('/bucketlists/', kwargs={'pk': 3}, format="json")
self.assertEqual(res.status_code, status.HTTP_401_UNAUTHORIZED)
self.assertEqual(res.status_code, status.HTTP_401_UNAUTHORIZED)
AssertionError:403!= 401