pytest-dev / pytest-django

A Django plugin for pytest.
https://pytest-django.readthedocs.io/
Other
1.37k stars 344 forks source link

Fix assert function signatures that expect HTTP response #1036

Closed mschoettle closed 1 year ago

mschoettle commented 1 year ago

Updating to the latest version(s) of django-stubs from 1.10.1 reveals errors such as:

Argument 1 to "assertContains" has incompatible type "_MonkeyPatchedWSGIResponse"; expected "HttpResponse" [arg-type]

django-stubs expects a HttpResponseBase instead of HttpResponse (see: https://github.com/typeddjango/django-stubs/blob/0381fdb0227f0db96a584d8e916ae6d8b3d025a3/django-stubs/test/testcases.pyi#L102)

This PR changes the signatures to be in line with what django-stubs defines.

adamchainz commented 1 year ago

Great, thanks!

mschoettle commented 1 year ago

@adamchainz Any chance a new version could be released soon that includes this fix?