1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +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

@@ -278,7 +278,7 @@ class TemplateViewTest(TestCase):
response = self.client.get('/template/simple/bar/')
self.assertEqual(response.status_code, 200)
self.assertEqual(response.context['foo'], 'bar')
self.assertTrue(isinstance(response.context['view'], View))
self.assertIsInstance(response.context['view'], View)
def test_extra_template_params(self):
"""
@@ -288,7 +288,7 @@ class TemplateViewTest(TestCase):
self.assertEqual(response.status_code, 200)
self.assertEqual(response.context['foo'], 'bar')
self.assertEqual(response.context['key'], 'value')
self.assertTrue(isinstance(response.context['view'], View))
self.assertIsInstance(response.context['view'], View)
def test_cached_views(self):
"""