diff options
| author | Tim Graham <timograham@gmail.com> | 2014-08-11 07:24:51 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-08-15 08:20:02 -0400 |
| commit | e122facbd89c5768528f5ba3b13552d43f989757 (patch) | |
| tree | 84f990612dffbb119a8620e1dccae10f4f76c45f /tests/utils_tests/test_html.py | |
| parent | deed00c0d803d324a3dfdeba52458b6b009c1a90 (diff) | |
Fixed #23269 -- Deprecated django.utils.remove_tags() and removetags filter.
Also the unused, undocumented django.utils.html.strip_entities() function.
Diffstat (limited to 'tests/utils_tests/test_html.py')
| -rw-r--r-- | tests/utils_tests/test_html.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/utils_tests/test_html.py b/tests/utils_tests/test_html.py index 0c6167ef50..d08eb0be2b 100644 --- a/tests/utils_tests/test_html.py +++ b/tests/utils_tests/test_html.py @@ -4,6 +4,7 @@ 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 @@ -124,7 +125,9 @@ class TestUtilsHtml(TestCase): # Strings that should come out untouched. values = ("&", "&a", "&a", "a&#a") for value in values: - self.check_output(f, value) + with warnings.catch_warnings(record=True): + warnings.simplefilter("always") + self.check_output(f, value) # Valid entities that should be stripped from the patterns. entities = ("", "", "&a;", "&fdasdfasdfasdf;") patterns = ( @@ -135,7 +138,9 @@ class TestUtilsHtml(TestCase): ) for entity in entities: for in_pattern, output in patterns: - self.check_output(f, in_pattern % {'entity': entity}, output) + with warnings.catch_warnings(record=True): + warnings.simplefilter("always") + self.check_output(f, in_pattern % {'entity': entity}, output) def test_escapejs(self): f = html.escapejs @@ -156,7 +161,9 @@ class TestUtilsHtml(TestCase): ("<a>x</a> <p><b>y</b></p>", "a b", "x <p>y</p>"), ) for value, tags, output in items: - self.assertEqual(f(value, tags), output) + with warnings.catch_warnings(record=True): + warnings.simplefilter("always") + self.assertEqual(f(value, tags), output) def test_smart_urlquote(self): quote = html.smart_urlquote |
