test.TestCase.assert(Not)Contains assumes response content is a page.
|Reported by:||Daniel Duan||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.