Opened 5 years ago
Closed 5 years ago
#31557 closed Cleanup/optimization (wontfix)
Use .assertTrue instead of .assertIs(..., True) in the unit testing section of the polls tutorial.
Reported by: | Alexandre Poitevin | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 3.0 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
We find this is several places in this section 6.
Maybe it was written before this method was added to the TestCase class?
Change History (2)
comment:1 by , 5 years ago
comment:2 by , 5 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Summary: | Use .assertTrue instead of .assertIs(..., True) in the unit testing section of the polls tutorial → Use .assertTrue instead of .assertIs(..., True) in the unit testing section of the polls tutorial. |
Our Python style describes why we prefer assertIs(..., True/False)
:
Use
assertIs(…, True/False)
for testing boolean values, rather thanassertTrue()
andassertFalse()
, so you can check the actual boolean value, not the truthiness of the expression.
Note:
See TracTickets
for help on using tickets.
See https://github.com/django/django/pull/6760#discussion_r66713822