Use assertIsInstance in tests.

Gives much nicer errors when it fails.
This commit is contained in:
Marc Tamlyn 2013-05-21 10:42:15 +01:00
parent 18856f866c
commit 09f8652765
31 changed files with 87 additions and 87 deletions

View file

@ -19,7 +19,7 @@ class CustomManagerTests(TestCase):
)
# The RelatedManager used on the 'books' descriptor extends the default
# manager
self.assertTrue(isinstance(p2.books, PublishedBookManager))
self.assertIsInstance(p2.books, PublishedBookManager)
b1 = Book.published_objects.create(
title="How to program", author="Rodney Dangerfield", is_published=True
@ -34,7 +34,7 @@ class CustomManagerTests(TestCase):
# The RelatedManager used on the 'authors' descriptor extends the
# default manager
self.assertTrue(isinstance(b2.authors, PersonManager))
self.assertIsInstance(b2.authors, PersonManager)
self.assertQuerysetEqual(
Book.published_objects.all(), [