From d170c63351944fd91b2206d10f89e7ff75b53b76 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Sat, 21 Jan 2017 20:02:00 -0500 Subject: Refs #23919 -- Removed misc references to Python 2. --- tests/forms_tests/tests/test_forms.py | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'tests/forms_tests') diff --git a/tests/forms_tests/tests/test_forms.py b/tests/forms_tests/tests/test_forms.py index 98c5ee8783..c13fbdf5c8 100644 --- a/tests/forms_tests/tests/test_forms.py +++ b/tests/forms_tests/tests/test_forms.py @@ -21,8 +21,7 @@ from django.template import Context, Template from django.test import SimpleTestCase from django.utils.datastructures import MultiValueDict from django.utils.encoding import force_text -from django.utils.html import format_html -from django.utils.safestring import SafeData, mark_safe +from django.utils.safestring import mark_safe class Person(Form): @@ -2028,22 +2027,6 @@ Password: form = PersonForm({}) self.assertEqual(form['name'].value(), 'John Doe') - def test_boundfield_rendering(self): - """ - Python 2 issue: Rendering a BoundField with bytestring content - doesn't lose it's safe string status (#22950). - """ - class CustomWidget(TextInput): - def render(self, name, value, attrs=None, choices=None, - renderer=None, extra_context=None): - return format_html(str(''), ' id=custom') - - class SampleForm(Form): - name = CharField(widget=CustomWidget) - - f = SampleForm(data={'name': 'bar'}) - self.assertIsInstance(force_text(f['name']), SafeData) - def test_custom_boundfield(self): class CustomField(CharField): def get_bound_field(self, form, name): -- cgit v1.3