Use more specific assertions than assertTrue in tests
We should change things like self.assertTrue(fetched.active_translation.title == 'Otsikko') to use assertEqual and things like self.assertTrue('id' in form.fields) to use assertIn. Attaching an initial patch. I used grep -rI "assertTrue" * | grep == to find instances that need changing.
Change History
(6)
| Owner: |
changed from nobody to averybigant
|
| Status: |
new → assigned
|
| Summary: |
Use more specify assertions than assertTrue in tests → Use more specific assertions than assertTrue in tests
|
| Resolution: |
→ fixed
|
| Status: |
assigned → closed
|
https://github.com/django/django/pull/3432
Should I create a new ticket for
assertFalse(a == b),assertFalse(a != b),assertFalse("foo" in a)etc. instances?