Allow assertContains to check for existence, without count
|Reported by:||nis@…||Owned by:||adrian|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I was a little surprised by the fact that django.test.testCase.assertContains does not cover the case where we want to make sure the content contains the text, but we do not care about the count. To me, this is the most common use case.
I suggest that this is made the default behavior (slightly changing functionality, by making the assertion less strict if no count is given).
I have attached a patch against trunk rev 5646. I did not write testcases, since none existed for the existing behavior.
Change History (4)
Changed 9 years ago by nis@…
comment:1 Changed 9 years ago by Nis Jørgensen <nis@…>
- Cc nis@… added
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset