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:2 by Mariusz Felisiak, 5 years ago

Resolution: wontfix
Status: newclosed
Summary: Use .assertTrue instead of .assertIs(..., True) in the unit testing section of the polls tutorialUse .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 than assertTrue() and assertFalse(), so you can check the actual boolean value, not the truthiness of the expression.

Note: See TracTickets for help on using tickets.
Back to Top