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

@ -588,11 +588,11 @@ class ContentFileTestCase(unittest.TestCase):
Test that ContentFile can accept both bytes and unicode and that the
retrieved content is of the same type.
"""
self.assertTrue(isinstance(ContentFile(b"content").read(), bytes))
self.assertIsInstance(ContentFile(b"content").read(), bytes)
if six.PY3:
self.assertTrue(isinstance(ContentFile("español").read(), six.text_type))
self.assertIsInstance(ContentFile("español").read(), six.text_type)
else:
self.assertTrue(isinstance(ContentFile("español").read(), bytes))
self.assertIsInstance(ContentFile("español").read(), bytes)
def test_content_saving(self):
"""