You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The easy fix would be to add text to the _MonkeyPatchedWSGIResponse as well. Doing so would not be quite correct though, as HttpResponseBase subclasses other than HttpResponse should not have the text field.
Same as in Support content attribute for a Testing Response. #968, the alternative would be to have multiple variants of _MonkeyPatchedWSGIResponse, and in tests assert which specific variant we expect. This would be more correct but more clumsy.
I'm not sure how to proceed here.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Django 5.2 added the HttpResponse.text field.
This field would be handy to use in tests, but _MonkeyPatchedWSGIResponse does not yet know about it.
I wanted to make a quick PR adding support for it, but ended up a little over my head :-)
I added the
text
field to the HttpResponse stub:However, _MonkeyPatchedWSGIResponse inherits from HttpResponseBase not from HttpResponse, and so if I access it in tests, I get type errors.
I think this is a similar situation as in #968 –
text
to the _MonkeyPatchedWSGIResponse as well. Doing so would not be quite correct though, as HttpResponseBase subclasses other than HttpResponse should not have thetext
field.I'm not sure how to proceed here.
The text was updated successfully, but these errors were encountered: