mirror of
https://github.com/django/django.git
synced 2025-10-17 05:47:44 +00:00
Use assertIsInstance in tests.
Gives much nicer errors when it fails.
This commit is contained in:
parent
18856f866c
commit
09f8652765
31 changed files with 87 additions and 87 deletions
|
@ -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(), [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue