djangorestframework-stubs
djangorestframework-stubs copied to clipboard
_MonkeyPatchedResponse missing attribute `wsgi_request`.
Bug report
What's wrong
The response comming from a request made with rest_framework.test.APIClient
has an attribute wsgi_request
of type WSGIRequest
. Currently, if used, mypy will throw out an error: error: "_MonkeyPatchedResponse" has no attribute "wsgi_request"
.
How is that should be
No error should be thrown by mypy (if we type: ignore
it, it works just fine in runtime).
System information
- OS: Linux
-
python
version: 3.11 -
django
version: 4.1.7 -
mypy
version: 1.1.1 -
django-stubs
version: 1.16.0