Simple JWT TokenRefreshView: response has two types
I’m having trouble accessing the data attribute on a Response object in Django Rest Framework after refreshing the access token. factory = APIRequestFactory() new_request = factory.post( "/api/token/refresh/", {"refresh": refresh_token}, format="json", ) new_request.META["CONTENT_TYPE"] = "application/json" refresh_view = TokenRefreshView.as_view() refresh_response = refresh_view(new_request) print(type(refresh_response)) refresh_response.data["message"] = "Token refresh successful" When I run this code, the print statement correctly