mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +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
|
@ -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):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue