Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed SyntaxError on Python 2.5 caused by a @unittest.skipIf class de…

…coration.
  • Loading branch information...
commit 7984b58e78f96541e48e7772be62afe2847aca24 1 parent d491702
Loic Bistuer authored

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  tests/regressiontests/templates/tests.py
6  tests/regressiontests/templates/tests.py
@@ -1765,9 +1765,7 @@ def test_include_only(self):
1765 1765
             'none'
1766 1766
         )
1767 1767
 
1768  
-
1769  
-@unittest.skipIf(' ' in __file__,
1770  
-    "The {%% ssi %%} tag in Django 1.4 doesn't support spaces in path.")
  1768
+skip_reason = "The {%% ssi %%} tag in Django 1.4 doesn't support spaces in path."
1771 1769
 class SSITests(unittest.TestCase):
1772 1770
     def setUp(self):
1773 1771
         self.this_dir = os.path.dirname(os.path.abspath(__file__))
@@ -1778,11 +1776,13 @@ def render_ssi(self, path):
1778 1776
         self.assertTrue(os.path.exists(path))
1779 1777
         return template.Template('{%% ssi %s %%}' % path).render(Context())
1780 1778
 
  1779
+    @unittest.skipIf(' ' in __file__, skip_reason)
1781 1780
     def test_allowed_paths(self):
1782 1781
         acceptable_path = os.path.join(self.ssi_dir, "..", "first", "test.html")
1783 1782
         with override_settings(ALLOWED_INCLUDE_ROOTS=(self.ssi_dir,)):
1784 1783
             self.assertEqual(self.render_ssi(acceptable_path), 'First template\n')
1785 1784
 
  1785
+    @unittest.skipIf(' ' in __file__, skip_reason)
1786 1786
     def test_relative_include_exploit(self):
1787 1787
         """
1788 1788
         May not bypass ALLOWED_INCLUDE_ROOTS with relative paths

0 notes on commit 7984b58

Please sign in to comment.
Something went wrong with that request. Please try again.