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.
* needs_better_patch: => 0
* has_patch: 0 => 1
* needs_tests: => 0
* needs_docs: => 0
Comment:
https://github.com/django/django/pull/6760
--
Ticket URL: <https://code.djangoproject.com/ticket/26747#comment:1>
* needs_better_patch: 0 => 1
* component: Uncategorized => Core (Other)
* stage: Unreviewed => Accepted
Comment:
As noted on the PR, I'm not convinced about the merits of
`assertTrue`/`False` rather than `assertEqual(val, True)` since such the
former pass if bool(val) is `True`/`False` which might be too loose.
--
Ticket URL: <https://code.djangoproject.com/ticket/26747#comment:2>
* needs_better_patch: 1 => 0
Comment:
Incorporated suggestion. Thanks.
--
Ticket URL: <https://code.djangoproject.com/ticket/26747#comment:3>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"4f336f66523001b009ab038b10848508fd208b3b" 4f336f6]:
{{{
#!CommitTicketReference repository=""
revision="4f336f66523001b009ab038b10848508fd208b3b"
Fixed #26747 -- Used more specific assertions in the Django test suite.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26747#comment:4>
Comment (by Tim Graham <timograham@…>):
In [changeset:"13d60298ea2a07242dc3952a9dfcd9c8857bf1f9" 13d60298]:
{{{
#!CommitTicketReference repository=""
revision="13d60298ea2a07242dc3952a9dfcd9c8857bf1f9"
[1.10.x] Fixed #26747 -- Used more specific assertions in the Django test
suite.
Backport of 4f336f66523001b009ab038b10848508fd208b3b from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26747#comment:5>
Comment (by Tim Graham <timograham@…>):
In [changeset:"7b08e01c1358aedbd46fa26c91d4613d642ff609" 7b08e01c]:
{{{
#!CommitTicketReference repository=""
revision="7b08e01c1358aedbd46fa26c91d4613d642ff609"
Refs #26747 -- Corrected a method name in tutorial05.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26747#comment:6>
Comment (by Tim Graham <timograham@…>):
In [changeset:"e5103de2d1a461544b73542df3ed0ad71a73dc21" e5103de]:
{{{
#!CommitTicketReference repository=""
revision="e5103de2d1a461544b73542df3ed0ad71a73dc21"
[1.10.x] Refs #26747 -- Corrected a method name in tutorial05.
Backport of 7b08e01c1358aedbd46fa26c91d4613d642ff609 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26747#comment:7>