diff options
| author | Tim Graham <timograham@gmail.com> | 2014-03-21 08:32:01 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-03-21 08:50:43 -0400 |
| commit | 8b81dee60c1533e714a310fa5c3907356042a64c (patch) | |
| tree | 1c8d78cae84d3e502d284b8117d61f3737386177 /tests/utils_tests/test_html.py | |
| parent | 99339c77f648fcdc30f6d914cb7efd902327ade7 (diff) | |
Removed fix_ampersands template filter per deprecation timeline.
Also removed related utility functions:
* django.utils.html.fix_ampersands
* django.utils.html.clean_html
Diffstat (limited to 'tests/utils_tests/test_html.py')
| -rw-r--r-- | tests/utils_tests/test_html.py | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/tests/utils_tests/test_html.py b/tests/utils_tests/test_html.py index 51ff38d190..b4e61b9fd6 100644 --- a/tests/utils_tests/test_html.py +++ b/tests/utils_tests/test_html.py @@ -4,11 +4,9 @@ from __future__ import unicode_literals from datetime import datetime import os from unittest import TestCase -import warnings from django.utils import html, safestring from django.utils._os import upath -from django.utils.deprecation import RemovedInDjango18Warning from django.utils.encoding import force_text @@ -131,31 +129,6 @@ class TestUtilsHtml(TestCase): for in_pattern, output in patterns: self.check_output(f, in_pattern % {'entity': entity}, output) - def test_fix_ampersands(self): - with warnings.catch_warnings(): - warnings.simplefilter("ignore", RemovedInDjango18Warning) - f = html.fix_ampersands - # Strings without ampersands or with ampersands already encoded. - values = ("a", "b", "&a;", "& &x; ", "asdf") - patterns = ( - ("%s", "%s"), - ("&%s", "&%s"), - ("&%s&", "&%s&"), - ) - - for value in values: - for in_pattern, out_pattern in patterns: - self.check_output(f, in_pattern % value, out_pattern % value) - - # Strings with ampersands that need encoding. - items = ( - ("&#;", "&#;"), - ("ͫ ;", "&#875 ;"), - ("abc;", "&#4abc;"), - ) - for value, output in items: - self.check_output(f, value, output) - def test_escapejs(self): f = html.escapejs items = ( @@ -168,20 +141,6 @@ class TestUtilsHtml(TestCase): for value, output in items: self.check_output(f, value, output) - def test_clean_html(self): - f = html.clean_html - items = ( - ('<p>I <i>believe</i> in <b>semantic markup</b>!</p>', '<p>I <em>believe</em> in <strong>semantic markup</strong>!</p>'), - ('I escape & I don\'t <a href="#" target="_blank">target</a>', 'I escape & I don\'t <a href="#" >target</a>'), - ('<p>I kill whitespace</p><br clear="all"><p> </p>', '<p>I kill whitespace</p>'), - # also a regression test for #7267: this used to raise an UnicodeDecodeError - ('<p>* foo</p><p>* bar</p>', '<ul>\n<li> foo</li><li> bar</li>\n</ul>'), - ) - with warnings.catch_warnings(): - warnings.simplefilter("ignore", RemovedInDjango18Warning) - for value, output in items: - self.check_output(f, value, output) - def test_remove_tags(self): f = html.remove_tags items = ( |
