#24714: Tidy up usage of assertEqual in tests
-------------------------------+--------------------
     Reporter:  alasdairnicol  |      Owner:  nobody
         Type:  Uncategorized  |     Status:  new
    Component:  Uncategorized  |    Version:  master
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 There are a few places in the tests where we are using self.assertEqual
 that could be more idiomatic.

 {{{
 self.assertEqual(True, x)  # prefer self.assertTrue(x)
 self.assertEqual(False, x)  # prefer self.assertFalse(x)
 self.assertEqual(None, x)  # prefer self.assertIsNone(x)
 self.assertEqual(True, x in y) # prefer self.assertIn(x, y)
 self.assertEqual(True, x == y) # prefer self.assertEqual(x, y)
 self.assertEqual(False, x == y) # prefer self.assertNotEqual(x, y)
 }}}

 I found these using the following greps

 {{{
 grep -rI assertEqual.True
 grep -rI assertEqual.False
 grep -rI assertEqual.None
 }}}

 This is a similar tidy up to #23620

--
Ticket URL: <https://code.djangoproject.com/ticket/24714>
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/056.410f75585511842836a658fcd6b32e98%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to