From 35203f736a2d65030485ddeedec9f66ac2b341ac Mon Sep 17 00:00:00 2001 From: Reinout van Rees Date: Fri, 21 Dec 2012 00:25:48 +0100 Subject: [PATCH] Removed unittest.skipUnless decorator: not available on python 2.6 --- rest_framework/tests/description.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) 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))