diff --git a/tests/admin_widgets/tests.py b/tests/admin_widgets/tests.py
index 9f5abe0684..bd2b294c33 100644
--- a/tests/admin_widgets/tests.py
+++ b/tests/admin_widgets/tests.py
@@ -16,7 +16,6 @@ from django.test import TestCase as DjangoTestCase
from django.test.utils import override_settings
from django.utils import six
from django.utils import translation
-from django.utils.html import conditional_escape
from . import models
from .widgetadmin import site as widget_admin_site
@@ -238,14 +237,14 @@ class FilteredSelectMultipleWidgetTest(DjangoTestCase):
def test_render(self):
w = widgets.FilteredSelectMultiple('test', False)
self.assertHTMLEqual(
- conditional_escape(w.render('test', 'test')),
+ w.render('test', 'test'),
'\n' % admin_static_prefix()
)
def test_stacked_render(self):
w = widgets.FilteredSelectMultiple('test', True)
self.assertHTMLEqual(
- conditional_escape(w.render('test', 'test')),
+ w.render('test', 'test'),
'\n' % admin_static_prefix()
)
@@ -257,13 +256,13 @@ class AdminDateWidgetTest(DjangoTestCase):
"""
w = widgets.AdminDateWidget()
self.assertHTMLEqual(
- conditional_escape(w.render('test', datetime(2007, 12, 1, 9, 30))),
+ w.render('test', datetime(2007, 12, 1, 9, 30)),
'',
)
# pass attrs to widget
w = widgets.AdminDateWidget(attrs={'size': 20, 'class': 'myDateField'})
self.assertHTMLEqual(
- conditional_escape(w.render('test', datetime(2007, 12, 1, 9, 30))),
+ w.render('test', datetime(2007, 12, 1, 9, 30)),
'',
)
@@ -275,13 +274,13 @@ class AdminTimeWidgetTest(DjangoTestCase):
"""
w = widgets.AdminTimeWidget()
self.assertHTMLEqual(
- conditional_escape(w.render('test', datetime(2007, 12, 1, 9, 30))),
+ w.render('test', datetime(2007, 12, 1, 9, 30)),
'',
)
# pass attrs to widget
w = widgets.AdminTimeWidget(attrs={'size': 20, 'class': 'myTimeField'})
self.assertHTMLEqual(
- conditional_escape(w.render('test', datetime(2007, 12, 1, 9, 30))),
+ w.render('test', datetime(2007, 12, 1, 9, 30)),
'',
)
@@ -289,7 +288,7 @@ class AdminSplitDateTimeWidgetTest(DjangoTestCase):
def test_render(self):
w = widgets.AdminSplitDateTime()
self.assertHTMLEqual(
- conditional_escape(w.render('test', datetime(2007, 12, 1, 9, 30))),
+ w.render('test', datetime(2007, 12, 1, 9, 30)),
'
Date:
Time:
',
)
@@ -300,7 +299,7 @@ class AdminSplitDateTimeWidgetTest(DjangoTestCase):
with translation.override('de-at'):
w.is_localized = True
self.assertHTMLEqual(
- conditional_escape(w.render('test', datetime(2007, 12, 1, 9, 30))),
+ w.render('test', datetime(2007, 12, 1, 9, 30)),
'Datum:
Zeit:
',
)
@@ -309,18 +308,18 @@ class AdminURLWidgetTest(DjangoTestCase):
def test_render(self):
w = widgets.AdminURLFieldWidget()
self.assertHTMLEqual(
- conditional_escape(w.render('test', '')),
+ w.render('test', ''),
''
)
self.assertHTMLEqual(
- conditional_escape(w.render('test', 'http://example.com')),
+ w.render('test', 'http://example.com'),
'Currently:http://example.com
Change:
'
)
def test_render_idn(self):
w = widgets.AdminURLFieldWidget()
self.assertHTMLEqual(
- conditional_escape(w.render('test', 'http://example-äüö.com')),
+ w.render('test', 'http://example-äüö.com'),
'Currently: http://example-äüö.com
Change:
'
)
@@ -351,12 +350,12 @@ class AdminFileWidgetTest(DjangoTestCase):
w = widgets.AdminFileWidget()
self.assertHTMLEqual(
- conditional_escape(w.render('test', album.cover_art)),
+ w.render('test', album.cover_art),
'Currently: albums\hybrid_theory.jpg
Change:
' % { 'STORAGE_URL': default_storage.url('') },
)
self.assertHTMLEqual(
- conditional_escape(w.render('test', SimpleUploadedFile('test', b'content'))),
+ w.render('test', SimpleUploadedFile('test', b'content')),
'',
)
@@ -371,7 +370,7 @@ class ForeignKeyRawIdWidgetTest(DjangoTestCase):
w = widgets.ForeignKeyRawIdWidget(rel, widget_admin_site)
self.assertHTMLEqual(
- conditional_escape(w.render('test', band.pk, attrs={})),
+ w.render('test', band.pk, attrs={}),
' Linkin Park' % dict(admin_static_prefix(), bandpk=band.pk)
)
@@ -399,7 +398,7 @@ class ForeignKeyRawIdWidgetTest(DjangoTestCase):
w = widgets.ForeignKeyRawIdWidget(rel, widget_admin_site)
self.assertHTMLEqual(
- conditional_escape(w.render('honeycomb_widget', big_honeycomb.pk, attrs={})),
+ w.render('honeycomb_widget', big_honeycomb.pk, attrs={}),
' Honeycomb object' % {'hcombpk': big_honeycomb.pk}
)
@@ -412,7 +411,7 @@ class ForeignKeyRawIdWidgetTest(DjangoTestCase):
w = widgets.ForeignKeyRawIdWidget(rel, widget_admin_site)
self.assertHTMLEqual(
- conditional_escape(w.render('individual_widget', subject1.pk, attrs={})),
+ w.render('individual_widget', subject1.pk, attrs={}),
' Individual object' % {'subj1pk': subject1.pk}
)
@@ -444,12 +443,12 @@ class ManyToManyRawIdWidgetTest(DjangoTestCase):
w = widgets.ManyToManyRawIdWidget(rel, widget_admin_site)
self.assertHTMLEqual(
- conditional_escape(w.render('test', [m1.pk, m2.pk], attrs={})),
+ w.render('test', [m1.pk, m2.pk], attrs={}),
' ' % dict(admin_static_prefix(), m1pk=m1.pk, m2pk=m2.pk)
)
self.assertHTMLEqual(
- conditional_escape(w.render('test', [m1.pk])),
+ w.render('test', [m1.pk]),
' ' % dict(admin_static_prefix(), m1pk=m1.pk)
)
@@ -465,12 +464,12 @@ class ManyToManyRawIdWidgetTest(DjangoTestCase):
w = widgets.ManyToManyRawIdWidget(rel, widget_admin_site)
self.assertHTMLEqual(
- conditional_escape(w.render('company_widget1', [c1.pk, c2.pk], attrs={})),
+ w.render('company_widget1', [c1.pk, c2.pk], attrs={}),
'' % {'c1pk': c1.pk, 'c2pk': c2.pk}
)
self.assertHTMLEqual(
- conditional_escape(w.render('company_widget2', [c1.pk])),
+ w.render('company_widget2', [c1.pk]),
'' % {'c1pk': c1.pk}
)