diff options
| author | Tim Graham <timograham@gmail.com> | 2015-08-17 10:03:22 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-09-23 19:31:09 -0400 |
| commit | 9a3dfa2a524aedb8580b7311585f9d52f252f4e7 (patch) | |
| tree | 5eb1f2b5879df2728bd626582d5803d86cd70d58 /tests | |
| parent | 27b2321793c62fb2cbb00fd2830c9387a187a84f (diff) | |
Refs #23261 -- Removed old style list syntax for unordered_list filter
Per deprecation timeline.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/template_tests/filter_tests/test_unordered_list.py | 57 |
1 files changed, 1 insertions, 56 deletions
diff --git a/tests/template_tests/filter_tests/test_unordered_list.py b/tests/template_tests/filter_tests/test_unordered_list.py index 4fbc22a657..eab9442780 100644 --- a/tests/template_tests/filter_tests/test_unordered_list.py +++ b/tests/template_tests/filter_tests/test_unordered_list.py @@ -1,6 +1,5 @@ from django.template.defaultfilters import unordered_list -from django.test import SimpleTestCase, ignore_warnings -from django.utils.deprecation import RemovedInDjango110Warning +from django.test import SimpleTestCase from django.utils.encoding import python_2_unicode_compatible from django.utils.safestring import mark_safe @@ -14,7 +13,6 @@ class UnorderedListTests(SimpleTestCase): output = self.engine.render_to_string('unordered_list01', {'a': ['x>', ['<y']]}) self.assertEqual(output, '\t<li>x>\n\t<ul>\n\t\t<li><y</li>\n\t</ul>\n\t</li>') - @ignore_warnings(category=RemovedInDjango110Warning) @setup({'unordered_list02': '{% autoescape off %}{{ a|unordered_list }}{% endautoescape %}'}) def test_unordered_list02(self): output = self.engine.render_to_string('unordered_list02', {'a': ['x>', ['<y']]}) @@ -36,35 +34,6 @@ class UnorderedListTests(SimpleTestCase): self.assertEqual(output, '\t<li>x>\n\t<ul>\n\t\t<li><y</li>\n\t</ul>\n\t</li>') -@ignore_warnings(category=RemovedInDjango110Warning) -class DeprecatedUnorderedListSyntaxTests(SimpleTestCase): - - @setup({'unordered_list01': '{{ a|unordered_list }}'}) - def test_unordered_list01(self): - output = self.engine.render_to_string('unordered_list01', {'a': ['x>', [['<y', []]]]}) - self.assertEqual(output, '\t<li>x>\n\t<ul>\n\t\t<li><y</li>\n\t</ul>\n\t</li>') - - @setup({'unordered_list02': '{% autoescape off %}{{ a|unordered_list }}{% endautoescape %}'}) - def test_unordered_list02(self): - output = self.engine.render_to_string('unordered_list02', {'a': ['x>', [['<y', []]]]}) - self.assertEqual(output, '\t<li>x>\n\t<ul>\n\t\t<li><y</li>\n\t</ul>\n\t</li>') - - @setup({'unordered_list03': '{{ a|unordered_list }}'}) - def test_unordered_list03(self): - output = self.engine.render_to_string('unordered_list03', {'a': ['x>', [[mark_safe('<y'), []]]]}) - self.assertEqual(output, '\t<li>x>\n\t<ul>\n\t\t<li><y</li>\n\t</ul>\n\t</li>') - - @setup({'unordered_list04': '{% autoescape off %}{{ a|unordered_list }}{% endautoescape %}'}) - def test_unordered_list04(self): - output = self.engine.render_to_string('unordered_list04', {'a': ['x>', [[mark_safe('<y'), []]]]}) - self.assertEqual(output, '\t<li>x>\n\t<ul>\n\t\t<li><y</li>\n\t</ul>\n\t</li>') - - @setup({'unordered_list05': '{% autoescape off %}{{ a|unordered_list }}{% endautoescape %}'}) - def test_unordered_list05(self): - output = self.engine.render_to_string('unordered_list05', {'a': ['x>', [['<y', []]]]}) - self.assertEqual(output, '\t<li>x>\n\t<ul>\n\t\t<li><y</li>\n\t</ul>\n\t</li>') - - class FunctionTests(SimpleTestCase): def test_list(self): @@ -171,27 +140,3 @@ class FunctionTests(SimpleTestCase): unordered_list(item_generator(), autoescape=False), '\t<li>ulitem-a</li>\n\t<li>ulitem-b</li>\n\t<li>ulitem-<a>c</a></li>', ) - - @ignore_warnings(category=RemovedInDjango110Warning) - def test_legacy(self): - """ - Old format for unordered lists should still work - """ - self.assertEqual(unordered_list(['item 1', []]), '\t<li>item 1</li>') - - self.assertEqual( - unordered_list(['item 1', [['item 1.1', []]]]), - '\t<li>item 1\n\t<ul>\n\t\t<li>item 1.1</li>\n\t</ul>\n\t</li>', - ) - - self.assertEqual( - unordered_list(['item 1', [['item 1.1', []], - ['item 1.2', []]]]), '\t<li>item 1\n\t<ul>\n\t\t<li>item 1.1' - '</li>\n\t\t<li>item 1.2</li>\n\t</ul>\n\t</li>', - ) - - self.assertEqual( - unordered_list(['States', [['Kansas', [['Lawrence', []], ['Topeka', []]]], ['Illinois', []]]]), - '\t<li>States\n\t<ul>\n\t\t<li>Kansas\n\t\t<ul>\n\t\t\t<li>Lawrence</li>' - '\n\t\t\t<li>Topeka</li>\n\t\t</ul>\n\t\t</li>\n\t\t<li>Illinois</li>\n\t</ul>\n\t</li>', - ) |
