From 9a3f8d9a9c63fc14a4e13738407f2b262de6649a Mon Sep 17 00:00:00 2001 From: Asif Saifuddin Auvi Date: Wed, 30 Nov 2016 16:42:43 +0600 Subject: [PATCH] converted asserts of descriptions test to pytest --- tests/test_description.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_description.py b/tests/test_description.py index fcb88287b..08d8bddec 100644 --- a/tests/test_description.py +++ b/tests/test_description.py @@ -60,7 +60,7 @@ class TestViewNamesAndDescriptions(TestCase): """ class MockView(APIView): pass - self.assertEqual(MockView().get_view_name(), 'Mock') + assert MockView().get_view_name() == 'Mock' def test_view_description_uses_docstring(self): """Ensure view descriptions are based on the docstring.""" @@ -80,7 +80,7 @@ class TestViewNamesAndDescriptions(TestCase): # hash style header #""" - self.assertEqual(MockView().get_view_description(), DESCRIPTION) + assert MockView().get_view_description() == DESCRIPTION def test_view_description_can_be_empty(self): """ @@ -89,7 +89,7 @@ class TestViewNamesAndDescriptions(TestCase): """ class MockView(APIView): pass - self.assertEqual(MockView().get_view_description(), '') + assert MockView().get_view_description() == '' def test_view_description_can_be_promise(self): """ @@ -111,7 +111,7 @@ class TestViewNamesAndDescriptions(TestCase): class MockView(APIView): __doc__ = MockLazyStr("a gettext string") - self.assertEqual(MockView().get_view_description(), 'a gettext string') + assert MockView().get_view_description() == 'a gettext string' def test_markdown(self): """ @@ -120,7 +120,7 @@ class TestViewNamesAndDescriptions(TestCase): if apply_markdown: gte_21_match = apply_markdown(DESCRIPTION) == MARKED_DOWN_gte_21 lt_21_match = apply_markdown(DESCRIPTION) == MARKED_DOWN_lt_21 - self.assertTrue(gte_21_match or lt_21_match) + assert gte_21_match or lt_21_match def test_dedent_tabs():