Skip to content

Commit b149d1f

Browse files
committed
Merge pull request django#1837 from loic/django14
Fixed SyntaxError on Python 2.5 caused by a @unittest.skipIf class decoration.
2 parents d491702 + 7984b58 commit b149d1f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/regressiontests/templates/tests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1765,9 +1765,7 @@ def test_include_only(self):
17651765
'none'
17661766
)
17671767

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."
17711769
class SSITests(unittest.TestCase):
17721770
def setUp(self):
17731771
self.this_dir = os.path.dirname(os.path.abspath(__file__))
@@ -1778,11 +1776,13 @@ def render_ssi(self, path):
17781776
self.assertTrue(os.path.exists(path))
17791777
return template.Template('{%% ssi %s %%}' % path).render(Context())
17801778

1779+
@unittest.skipIf(' ' in __file__, skip_reason)
17811780
def test_allowed_paths(self):
17821781
acceptable_path = os.path.join(self.ssi_dir, "..", "first", "test.html")
17831782
with override_settings(ALLOWED_INCLUDE_ROOTS=(self.ssi_dir,)):
17841783
self.assertEqual(self.render_ssi(acceptable_path), 'First template\n')
17851784

1785+
@unittest.skipIf(' ' in __file__, skip_reason)
17861786
def test_relative_include_exploit(self):
17871787
"""
17881788
May not bypass ALLOWED_INCLUDE_ROOTS with relative paths

0 commit comments

Comments
 (0)