mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Refs #23269 -- Removed the removetags template tag and related functions per deprecation timeline.
This commit is contained in:
parent
785cc71d5b
commit
222d063301
7 changed files with 7 additions and 189 deletions
|
@ -4,10 +4,9 @@ from __future__ import unicode_literals
|
|||
import os
|
||||
from datetime import datetime
|
||||
|
||||
from django.test import SimpleTestCase, ignore_warnings
|
||||
from django.test import SimpleTestCase
|
||||
from django.utils import html, safestring, six
|
||||
from django.utils._os import upath
|
||||
from django.utils.deprecation import RemovedInDjango110Warning
|
||||
from django.utils.encoding import force_text
|
||||
|
||||
|
||||
|
@ -123,25 +122,6 @@ class TestUtilsHtml(SimpleTestCase):
|
|||
for value, output in items:
|
||||
self.check_output(f, value, output)
|
||||
|
||||
@ignore_warnings(category=RemovedInDjango110Warning)
|
||||
def test_strip_entities(self):
|
||||
f = html.strip_entities
|
||||
# Strings that should come out untouched.
|
||||
values = ("&", "&a", "&a", "a&#a")
|
||||
for value in values:
|
||||
self.check_output(f, value)
|
||||
# Valid entities that should be stripped from the patterns.
|
||||
entities = ("", "", "&a;", "&fdasdfasdfasdf;")
|
||||
patterns = (
|
||||
("asdf %(entity)s ", "asdf "),
|
||||
("%(entity)s%(entity)s", ""),
|
||||
("&%(entity)s%(entity)s", "&"),
|
||||
("%(entity)s3", "3"),
|
||||
)
|
||||
for entity in entities:
|
||||
for in_pattern, output in patterns:
|
||||
self.check_output(f, in_pattern % {'entity': entity}, output)
|
||||
|
||||
def test_escapejs(self):
|
||||
f = html.escapejs
|
||||
items = (
|
||||
|
@ -160,16 +140,6 @@ class TestUtilsHtml(SimpleTestCase):
|
|||
for value, output in items:
|
||||
self.check_output(f, value, output)
|
||||
|
||||
@ignore_warnings(category=RemovedInDjango110Warning)
|
||||
def test_remove_tags(self):
|
||||
f = html.remove_tags
|
||||
items = (
|
||||
("<b><i>Yes</i></b>", "b i", "Yes"),
|
||||
("<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)
|
||||
|
||||
def test_smart_urlquote(self):
|
||||
quote = html.smart_urlquote
|
||||
# Ensure that IDNs are properly quoted
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue