#25780 closed Cleanup/optimization (fixed)
Remove redundant response.status_code assertions in tests
Reported by: | Tim Graham | Owned by: | Alex Morozov |
---|---|---|---|
Component: | Testing framework | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
self.assertContains(response, '...')
also checks the response's status code. There are a lot of places (in the admin_views
tests is the place I noticed it) where there's a redundant assertion that verifies self.assertEqual(response.status_code, 200)
.
Note:
See TracTickets
for help on using tickets.
@timgraham, are you talking about these? Could there be a situation when a view fails but still returns the wanted text? If not, I'll try to remove 'em.