diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-11-01 01:21:34 -0700 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-11-01 01:21:34 -0700 |
| commit | b149d1fcd630d307f3d921a9e20055ed98732946 (patch) | |
| tree | d8c6e616308ecd6fff7c2561c2251c5b692038d5 | |
| parent | d491702ed7ef704a204d358024590e5f7c2e3c47 (diff) | |
| parent | 7984b58e78f96541e48e7772be62afe2847aca24 (diff) | |
Merge pull request #1837 from loic/django14
Fixed SyntaxError on Python 2.5 caused by a @unittest.skipIf class decoration.
| -rw-r--r-- | tests/regressiontests/templates/tests.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py index d3defb8183..8565d19289 100644 --- a/tests/regressiontests/templates/tests.py +++ b/tests/regressiontests/templates/tests.py @@ -1765,9 +1765,7 @@ class RequestContextTests(BaseTemplateResponseTest): '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 @@ class SSITests(unittest.TestCase): 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 |
