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:
@@ -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'])
|
||||
|
||||
Reference in New Issue
Block a user