From e122facbd89c5768528f5ba3b13552d43f989757 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Mon, 11 Aug 2014 07:24:51 -0400 Subject: Fixed #23269 -- Deprecated django.utils.remove_tags() and removetags filter. Also the unused, undocumented django.utils.html.strip_entities() function. --- tests/utils_tests/test_html.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'tests/utils_tests/test_html.py') 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): ("x

y

", "a b", "x

y

"), ) 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 -- cgit v1.3