test.TestCase.assert(Not)Contains assumes response content is a page.
|Reported by:||DaNmarner||Owned by:||nobody|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Currently, if a test fails on django.TestCase.assertContains/assertNotContains(), Django says "Couldn't retrieve page: Response code was %d", which is an odd message if someone expects the response content is not a web page.
It took me about 2 minutes to comprehend this message the first time when I was working on a webapp that speaks JSON.
The message should use the word "content" instead of "page", it does make a difference.
Change History (6)
Changed 6 years ago by DaNmarner
comment:1 Changed 6 years ago by russellm
- Needs documentation unset
- Needs tests unset
- Patch needs improvement set
- Triage Stage changed from Unreviewed to Accepted