Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
Merge pull request django#1837 from loic/django14
Browse files Browse the repository at this point in the history
Fixed SyntaxError on Python 2.5 caused by a @unittest.skipIf class decoration.
  • Loading branch information
aaugustin committed Nov 1, 2013
2 parents d491702 + 7984b58 commit b149d1f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/regressiontests/templates/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__))
Expand All @@ -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
Expand Down

0 comments on commit b149d1f

Please sign in to comment.