Opened 5 years ago

Closed 5 years ago

#29828 closed Uncategorized (invalid)

Use assertFalse and assertTrue instead of assertIs in "Writing your first Django app"

Reported by: Pablo Fernandez Owned by: nobody
Component: Documentation Version: 2.1
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


In part 5 of "Writing your first Django app" ( the tests are using assertIs() instead of assertTrue() or assertFalse, which feel more appropriate.

Change History (3)

comment:1 Changed 5 years ago by Pablo Fernandez

comment:2 Changed 5 years ago by Curtis Maloney

Has patch: set

Would it be better, since it's the tutorial, to introduce assertEqual, then progress to assertIs, and finally assertTrue / assertFalse ?
I realise this is a Django tutorial, not a unittest one, but I still feel it's better to show new developers the common tools and why they'd pick which.

comment:3 Changed 5 years ago by Tim Graham

Resolution: invalid
Status: newclosed

assertIs() works differently from assertFalse() and assertTrue(). assertFalse() will pass if bool(value) is False and likewise for assertTrue().

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