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_cycle.py | |
| parent | 66f9a74b4514bd259976ce8ee3a4e78288358a5f (diff) | |
Applied ignore_warnings to Django tests
Diffstat (limited to 'tests/template_tests/syntax_tests/test_cycle.py')
| -rw-r--r-- | tests/template_tests/syntax_tests/test_cycle.py | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/tests/template_tests/syntax_tests/test_cycle.py b/tests/template_tests/syntax_tests/test_cycle.py index 8a47ff8879..88a7187b1a 100644 --- a/tests/template_tests/syntax_tests/test_cycle.py +++ b/tests/template_tests/syntax_tests/test_cycle.py @@ -1,7 +1,5 @@ -import warnings - from django.template import TemplateSyntaxError -from django.test import SimpleTestCase +from django.test import SimpleTestCase, ignore_warnings from django.utils.deprecation import RemovedInDjango20Warning from ..utils import setup @@ -141,24 +139,21 @@ class CycleTagTests(SimpleTestCase): output = self.engine.render_to_string('cycle25', {'a': '<'}) self.assertEqual(output, '<') + @ignore_warnings(category=RemovedInDjango20Warning) @setup({'cycle26': '{% load cycle from future %}{% cycle a b as ab %}{% cycle ab %}'}) def test_cycle26(self): - with warnings.catch_warnings(): - warnings.simplefilter("ignore", RemovedInDjango20Warning) - output = self.engine.render_to_string('cycle26', {'a': '<', 'b': '>'}) + output = self.engine.render_to_string('cycle26', {'a': '<', 'b': '>'}) self.assertEqual(output, '<>') + @ignore_warnings(category=RemovedInDjango20Warning) @setup({'cycle27': '{% load cycle from future %}' '{% autoescape off %}{% cycle a b as ab %}{% cycle ab %}{% endautoescape %}'}) def test_cycle27(self): - with warnings.catch_warnings(): - warnings.simplefilter("ignore", RemovedInDjango20Warning) - output = self.engine.render_to_string('cycle27', {'a': '<', 'b': '>'}) + output = self.engine.render_to_string('cycle27', {'a': '<', 'b': '>'}) self.assertEqual(output, '<>') + @ignore_warnings(category=RemovedInDjango20Warning) @setup({'cycle28': '{% load cycle from future %}{% cycle a|safe b as ab %}{% cycle ab %}'}) def test_cycle28(self): - with warnings.catch_warnings(): - warnings.simplefilter("ignore", RemovedInDjango20Warning) - output = self.engine.render_to_string('cycle28', {'a': '<', 'b': '>'}) + output = self.engine.render_to_string('cycle28', {'a': '<', 'b': '>'}) self.assertEqual(output, '<>') |
