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/comment_tests | |
| parent | 18856f866cc0e1cc703ae3f4c84b3c25a847b370 (diff) | |
Use assertIsInstance in tests.
Gives much nicer errors when it fails.
Diffstat (limited to 'tests/comment_tests')
| -rw-r--r-- | tests/comment_tests/tests/test_comment_form.py | 2 | ||||
| -rw-r--r-- | tests/comment_tests/tests/test_templatetags.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/comment_tests/tests/test_comment_form.py b/tests/comment_tests/tests/test_comment_form.py index 39ba57928d..a30f13a073 100644 --- a/tests/comment_tests/tests/test_comment_form.py +++ b/tests/comment_tests/tests/test_comment_form.py @@ -54,7 +54,7 @@ class CommentFormTests(CommentTestCase): def testGetCommentObject(self): f = self.testValidPost() c = f.get_comment_object() - self.assertTrue(isinstance(c, Comment)) + self.assertIsInstance(c, Comment) self.assertEqual(c.content_object, Article.objects.get(pk=1)) self.assertEqual(c.comment, "This is my comment") c.save() diff --git a/tests/comment_tests/tests/test_templatetags.py b/tests/comment_tests/tests/test_templatetags.py index 185f6de297..1971c21a58 100644 --- a/tests/comment_tests/tests/test_templatetags.py +++ b/tests/comment_tests/tests/test_templatetags.py @@ -32,7 +32,7 @@ class CommentTemplateTagTests(CommentTestCase): t = "{% load comments %}" + (tag or "{% get_comment_form for comment_tests.article a.id as form %}") ctx, out = self.render(t, a=Article.objects.get(pk=1)) self.assertEqual(out, "") - self.assertTrue(isinstance(ctx["form"], CommentForm)) + self.assertIsInstance(ctx["form"], CommentForm) def testGetCommentFormFromLiteral(self): self.testGetCommentForm("{% get_comment_form for comment_tests.article 1 as form %}") |
