diff --git a/rest_framework/tests/description.py b/rest_framework/tests/description.py index 2c25dee10..9a3086b7a 100644 --- a/rest_framework/tests/description.py +++ b/rest_framework/tests/description.py @@ -1,5 +1,3 @@ -import unittest - from django.test import TestCase from rest_framework.views import APIView from rest_framework.compat import apply_markdown @@ -108,17 +106,17 @@ class TestViewNamesAndDescriptions(TestCase): pass self.assertEquals(MockView().get_description(), '') - @unittest.skipUnless(apply_markdown, 'markdown not installed') def test_markdown(self): """Ensure markdown to HTML works as expected""" - 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) + 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) - @unittest.skipUnless(apply_restructuredtext, 'docutils not installed') def test_restructuredtext(self): """Ensure restructuredtext to HTML works as expected.""" - # The output isn't tested verbatim because of small rendering changes - # between docutils versions. - self.assertTrue('

another header

' - in apply_restructuredtext(DESCRIPTION)) + if apply_restructuredtext: + # The output isn't tested verbatim because of small rendering changes + # between docutils versions. + self.assertTrue('

another header

' + in apply_restructuredtext(DESCRIPTION))