Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…coration.
  • Loading branch information...
commit 7984b58e78f96541e48e7772be62afe2847aca24 1 parent d491702
@loic loic authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 tests/regressiontests/templates/tests.py
View
6 tests/regressiontests/templates/tests.py
@@ -1765,9 +1765,7 @@ def test_include_only(self):
'none'
)
-
-@unittest.skipIf(' ' in __file__,
- "The {%% ssi %%} tag in Django 1.4 doesn't support spaces in path.")
+skip_reason = "The {%% ssi %%} tag in Django 1.4 doesn't support spaces in path."
class SSITests(unittest.TestCase):
def setUp(self):
self.this_dir = os.path.dirname(os.path.abspath(__file__))
@@ -1778,11 +1776,13 @@ def render_ssi(self, path):
self.assertTrue(os.path.exists(path))
return template.Template('{%% ssi %s %%}' % path).render(Context())
+ @unittest.skipIf(' ' in __file__, skip_reason)
def test_allowed_paths(self):
acceptable_path = os.path.join(self.ssi_dir, "..", "first", "test.html")
with override_settings(ALLOWED_INCLUDE_ROOTS=(self.ssi_dir,)):
self.assertEqual(self.render_ssi(acceptable_path), 'First template\n')
+ @unittest.skipIf(' ' in __file__, skip_reason)
def test_relative_include_exploit(self):
"""
May not bypass ALLOWED_INCLUDE_ROOTS with relative paths
Please sign in to comment.
Something went wrong with that request. Please try again.