#26747: Use more specific assertions in tests
--------------------------------------+--------------------
Reporter: jdufresne | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Uncategorized | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
Like #23620. I found more patterns that could use more specific
assertions.
Example patterns:
{{{
#!python
self.assertEqual(expression, False)
self.assertEqual(expression, True)
self.assertEqual(expression, None)
self.assertNotEqual(expression, None)
}}}
Will change these to:
{{{
#!python
self.assertFalse(expression)
self.assertTrue(expression)
self.assertIsNone(expression)
self.assertIsNotNone(expression)
}}}
Python docs on assertions: https://docs.python.org/3/library/unittest.html
#assert-methods
--
Ticket URL: <https://code.djangoproject.com/ticket/26747>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/052.e4f4ce59e2eec11eea3f3c078671ffb0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.