diff options
| author | Tim Graham <timograham@gmail.com> | 2016-12-31 08:26:23 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-01-17 20:52:01 -0500 |
| commit | d67a46e10459858b681176a3e1f8c6bca39d2ac7 (patch) | |
| tree | 6684f940e9961299d9520710e1fe16187194d0f9 /tests/admin_changelist | |
| parent | 7510b872e7a2c06e935b0469813320a65f679f64 (diff) | |
Refs #25135 -- Removed support for the contrib.admin allow_tags attribute.
Per deprecation timeline.
Diffstat (limited to 'tests/admin_changelist')
| -rw-r--r-- | tests/admin_changelist/tests.py | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/tests/admin_changelist/tests.py b/tests/admin_changelist/tests.py index b2292a77a0..2f0f6ad46b 100644 --- a/tests/admin_changelist/tests.py +++ b/tests/admin_changelist/tests.py @@ -11,11 +11,10 @@ from django.contrib.admin.views.main import ALL_VAR, SEARCH_VAR, ChangeList from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.template import Context, Template -from django.test import TestCase, ignore_warnings, override_settings +from django.test import TestCase, override_settings from django.test.client import RequestFactory from django.urls import reverse from django.utils import formats, six -from django.utils.deprecation import RemovedInDjango20Warning from .admin import ( BandAdmin, ChildAdmin, ChordsBandAdmin, ConcertAdmin, @@ -253,34 +252,6 @@ class ChangeListTests(TestCase): with self.assertRaises(IncorrectLookupParameters): ChangeList(request, Child, *get_changelist_args(m)) - @ignore_warnings(category=RemovedInDjango20Warning) - def test_result_list_with_allow_tags(self): - """ - Test for deprecation of allow_tags attribute - """ - new_parent = Parent.objects.create(name='parent') - for i in range(2): - Child.objects.create(name='name %s' % i, parent=new_parent) - request = self.factory.get('/child/') - m = ChildAdmin(Child, custom_site) - - def custom_method(self, obj=None): - return 'Unsafe html <br />' - custom_method.allow_tags = True - - # Add custom method with allow_tags attribute - m.custom_method = custom_method - m.list_display = ['id', 'name', 'parent', 'custom_method'] - - cl = ChangeList(request, Child, *get_changelist_args(m)) - FormSet = m.get_changelist_formset(request) - cl.formset = FormSet(queryset=cl.result_list) - template = Template('{% load admin_list %}{% spaceless %}{% result_list cl %}{% endspaceless %}') - context = Context({'cl': cl}) - table_output = template.render(context) - custom_field_html = '<td class="field-custom_method">Unsafe html <br /></td>' - self.assertInHTML(custom_field_html, table_output) - def test_custom_paginator(self): new_parent = Parent.objects.create(name='parent') for i in range(200): |
