1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

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

@@ -24,7 +24,7 @@ class ListViewTests(TestCase):
self.assertEqual(res.status_code, 200)
self.assertTemplateUsed(res, 'generic_views/author_list.html')
self.assertEqual(list(res.context['object_list']), list(Author.objects.all()))
self.assertTrue(isinstance(res.context['view'], View))
self.assertIsInstance(res.context['view'], View)
self.assertIs(res.context['author_list'], res.context['object_list'])
self.assertIsNone(res.context['paginator'])
self.assertIsNone(res.context['page_obj'])