self.assertIs(future_question.was_published_recently(), False)
assertIs
(first, second, msg=None)assertIsNot
(first, second, msg=None)
Test that first and second evaluate (or don’t evaluate) to the same object.
New in version 3.1.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4a3852af-4809-45b9-bd34-bcc37ee57966%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
The reason why assertIs is used instead of assertFalse is that the latter actually tests for falsy values and can sometimes hide bugs.
self.assertIs(future_question.was_published_recently(), bool)
self.assertEquals(future_question.was_published_recently(), True)