diff options
| author | Claude Paroz <claude@2xlibre.net> | 2014-12-21 21:19:05 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2014-12-30 18:16:25 +0100 |
| commit | 51890ce8898f821d28f2f6fb6071c936e9bd88f0 (patch) | |
| tree | 6522c597d411086b0a5c2ec3dd7a1d9bc2feeafd /tests/template_tests/syntax_tests/test_ssi.py | |
| parent | 66f9a74b4514bd259976ce8ee3a4e78288358a5f (diff) | |
Applied ignore_warnings to Django tests
Diffstat (limited to 'tests/template_tests/syntax_tests/test_ssi.py')
| -rw-r--r-- | tests/template_tests/syntax_tests/test_ssi.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/tests/template_tests/syntax_tests/test_ssi.py b/tests/template_tests/syntax_tests/test_ssi.py index c5e89b0d2f..bc70aca9c6 100644 --- a/tests/template_tests/syntax_tests/test_ssi.py +++ b/tests/template_tests/syntax_tests/test_ssi.py @@ -1,7 +1,6 @@ import os -import warnings -from django.test import SimpleTestCase +from django.test import ignore_warnings, SimpleTestCase from django.utils.deprecation import RemovedInDjango19Warning from ..utils import ROOT, setup @@ -32,20 +31,18 @@ class SsiTagTests(SimpleTestCase): self.assertEqual(output, ''), # Test passing as a variable + @ignore_warnings(category=RemovedInDjango19Warning) @setup({'ssi04': '{% load ssi from future %}{% ssi ssi_file %}'}) def test_ssi04(self): - with warnings.catch_warnings(): - warnings.simplefilter("ignore", RemovedInDjango19Warning) - output = self.engine.render_to_string('ssi04', { - 'ssi_file': os.path.join(ROOT, 'templates', 'ssi_include.html') - }) + output = self.engine.render_to_string('ssi04', { + 'ssi_file': os.path.join(ROOT, 'templates', 'ssi_include.html') + }) self.assertEqual(output, 'This is for testing an ssi include. {{ test }}\n') + @ignore_warnings(category=RemovedInDjango19Warning) @setup({'ssi05': '{% load ssi from future %}{% ssi ssi_file %}'}) def test_ssi05(self): - with warnings.catch_warnings(): - warnings.simplefilter("ignore", RemovedInDjango19Warning) - output = self.engine.render_to_string('ssi05', {'ssi_file': 'no_file'}) + output = self.engine.render_to_string('ssi05', {'ssi_file': 'no_file'}) self.assertEqual(output, '') # Test parsed output |
