Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SimpleTestCase.assert method response types #942

Conversation

intgr
Copy link
Collaborator

@intgr intgr commented Apr 28, 2022

I have made things!

Since PR #909, SimpleTestCase.client.get() etc methods return a class that no longer derives from HttpResponse, but instead HttpResponseBase. The assert* methods taking response should be updated as well.

Usage like this no longer causes an error:

    def test_contains_headers_of_api_response(self):
        resp = self.client.get('/html1')
        self.assertNotContains(resp, '>text/html; charset=utf-8<')

Discovered while trying to update djangorestframework-stubs to use django-stubs git master.

Since PR 909, SimpleTestCase.client.get() etc methods return a class that no longer derives from `HttpResponse`, but instead `HttpResponseBase`, the `assert*` methods taking response should be updated as well.

Discovered while trying to update djangorestframework-stubs to django-stubs as of master.
@sobolevn sobolevn merged commit e0f45e4 into typeddjango:master Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants