Django APIClient login not working
问题 I'm having problem authenticating with my Django Rest Framework API in Unit Unit Tests. The system works as expected when accessing it through the browser. I however receive a 401 HTTP status when sending a put request to the following class at the following endpoint: class UserDetail(RetrieveModelMixin, DestroyModelMixin, UpdateModelMixin, GenericViewSet): authentication_classes = (BasicAuthentication, TokenAuthentication) permission_classes = IsAuthenticated, queryset = CustomUser.objects