diff options
author | Marc Tamlyn <marc.tamlyn@gmail.com> | 2013-05-21 10:42:15 +0100 |
---|---|---|
committer | Marc Tamlyn <marc.tamlyn@gmail.com> | 2013-05-21 10:42:15 +0100 |
commit | 09f865276554f35060ff939722ec4cefd578edf6 (patch) | |
tree | 39afbc8547b1e05cf58855369dbb4647fb642c84 /tests/datatypes | |
parent | 18856f866cc0e1cc703ae3f4c84b3c25a847b370 (diff) | |
download | django-09f865276554f35060ff939722ec4cefd578edf6.tar.gz |
Use assertIsInstance in tests.
Gives much nicer errors when it fails.
Diffstat (limited to 'tests/datatypes')
-rw-r--r-- | tests/datatypes/tests.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/datatypes/tests.py b/tests/datatypes/tests.py index f0ec5f3c0a..b6b52dedf2 100644 --- a/tests/datatypes/tests.py +++ b/tests/datatypes/tests.py @@ -74,7 +74,7 @@ class DataTypesTestCase(TestCase): database should be unicode.""" d = Donut.objects.create(name='Jelly Donut', review='Outstanding') newd = Donut.objects.get(id=d.id) - self.assertTrue(isinstance(newd.review, six.text_type)) + self.assertIsInstance(newd.review, six.text_type) @skipIfDBFeature('supports_timezones') def test_error_on_timezone(self): @@ -90,7 +90,7 @@ class DataTypesTestCase(TestCase): a Python datetime.date, not a datetime.datetime""" b = RumBaba.objects.create() # Verify we didn't break DateTimeField behavior - self.assertTrue(isinstance(b.baked_timestamp, datetime.datetime)) + self.assertIsInstance(b.baked_timestamp, datetime.datetime) # We need to test this this way because datetime.datetime inherits # from datetime.date: - self.assertTrue(isinstance(b.baked_date, datetime.date) and not isinstance(b.baked_date, datetime.datetime)) + self.assertIsInstance(b.baked_date, datetime.date) and not isinstance(b.baked_date, datetime.datetime) |