diff options
| author | Tim Graham <timograham@gmail.com> | 2015-08-18 10:09:17 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-09-23 19:31:09 -0400 |
| commit | 222d0633010e2f37f9fbd2d0559ecc4a5643c738 (patch) | |
| tree | 5f8fce14ce26c2ae0e3548c7a6c07cdc0389082b /tests/template_tests | |
| parent | 785cc71d5b3300e2702b0b2fc7316e58ca70b563 (diff) | |
Refs #23269 -- Removed the removetags template tag and related functions per deprecation timeline.
Diffstat (limited to 'tests/template_tests')
| -rw-r--r-- | tests/template_tests/filter_tests/test_removetags.py | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/tests/template_tests/filter_tests/test_removetags.py b/tests/template_tests/filter_tests/test_removetags.py deleted file mode 100644 index 9cc6c5a4f9..0000000000 --- a/tests/template_tests/filter_tests/test_removetags.py +++ /dev/null @@ -1,49 +0,0 @@ -from django.template.defaultfilters import removetags -from django.test import SimpleTestCase, ignore_warnings -from django.utils.deprecation import RemovedInDjango110Warning -from django.utils.safestring import mark_safe - -from ..utils import setup - - -@ignore_warnings(category=RemovedInDjango110Warning) -class RemovetagsTests(SimpleTestCase): - - @setup({'removetags01': '{{ a|removetags:"a b" }} {{ b|removetags:"a b" }}'}) - def test_removetags01(self): - output = self.engine.render_to_string( - 'removetags01', - { - 'a': '<a>x</a> <p><b>y</b></p>', - 'b': mark_safe('<a>x</a> <p><b>y</b></p>'), - }, - ) - self.assertEqual(output, 'x <p>y</p> x <p>y</p>') - - @setup({'removetags02': - '{% autoescape off %}{{ a|removetags:"a b" }} {{ b|removetags:"a b" }}{% endautoescape %}'}) - def test_removetags02(self): - output = self.engine.render_to_string( - 'removetags02', - { - 'a': '<a>x</a> <p><b>y</b></p>', - 'b': mark_safe('<a>x</a> <p><b>y</b></p>'), - }, - ) - self.assertEqual(output, 'x <p>y</p> x <p>y</p>') - - -@ignore_warnings(category=RemovedInDjango110Warning) -class FunctionTests(SimpleTestCase): - - def test_removetags(self): - self.assertEqual( - removetags( - 'some <b>html</b> with <script>alert("You smell")</script> disallowed <img /> tags', - 'script img', - ), - 'some <b>html</b> with alert("You smell") disallowed tags', - ) - - def test_non_string_input(self): - self.assertEqual(removetags(123, 'a'), '123') |
