mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Refs #25135 -- Removed support for the contrib.admin allow_tags attribute.
Per deprecation timeline.
This commit is contained in:
@@ -35,9 +35,7 @@ from django.urls import NoReverseMatch, resolve, reverse
|
||||
from django.utils import formats, six, translation
|
||||
from django.utils._os import upath
|
||||
from django.utils.cache import get_max_age
|
||||
from django.utils.deprecation import (
|
||||
RemovedInDjango20Warning, RemovedInDjango21Warning,
|
||||
)
|
||||
from django.utils.deprecation import RemovedInDjango21Warning
|
||||
from django.utils.encoding import force_bytes, force_text, iri_to_uri
|
||||
from django.utils.html import escape
|
||||
from django.utils.http import urlencode
|
||||
@@ -4655,7 +4653,6 @@ class ReadonlyTest(AdminFieldExtractionMixin, TestCase):
|
||||
def setUp(self):
|
||||
self.client.force_login(self.superuser)
|
||||
|
||||
@ignore_warnings(category=RemovedInDjango20Warning) # for allow_tags deprecation
|
||||
def test_readonly_get(self):
|
||||
response = self.client.get(reverse('admin:admin_views_post_add'))
|
||||
self.assertEqual(response.status_code, 200)
|
||||
@@ -4673,12 +4670,6 @@ class ReadonlyTest(AdminFieldExtractionMixin, TestCase):
|
||||
self.assertContains(response, 'Multiline<br />test<br />string')
|
||||
self.assertContains(response, '<div class="readonly">Multiline<br />html<br />content</div>', html=True)
|
||||
self.assertContains(response, 'InlineMultiline<br />test<br />string')
|
||||
# Remove only this last line when the deprecation completes.
|
||||
self.assertContains(
|
||||
response,
|
||||
'<div class="readonly">Multiline<br />html<br />content<br />with allow tags</div>',
|
||||
html=True
|
||||
)
|
||||
|
||||
self.assertContains(response, formats.localize(datetime.date.today() - datetime.timedelta(days=7)))
|
||||
|
||||
@@ -4708,7 +4699,6 @@ class ReadonlyTest(AdminFieldExtractionMixin, TestCase):
|
||||
response = self.client.get(reverse('admin:admin_views_post_change', args=(p.pk,)))
|
||||
self.assertContains(response, "%d amount of cool" % p.pk)
|
||||
|
||||
@ignore_warnings(category=RemovedInDjango20Warning) # for allow_tags deprecation
|
||||
def test_readonly_text_field(self):
|
||||
p = Post.objects.create(
|
||||
title="Readonly test", content="test",
|
||||
@@ -4802,7 +4792,6 @@ class ReadonlyTest(AdminFieldExtractionMixin, TestCase):
|
||||
field = self.get_admin_readonly_field(response, 'plotdetails')
|
||||
self.assertEqual(field.contents(), '-') # default empty value
|
||||
|
||||
@ignore_warnings(category=RemovedInDjango20Warning) # for allow_tags deprecation
|
||||
def test_readonly_field_overrides(self):
|
||||
"""
|
||||
Regression test for #22087 - ModelForm Meta overrides are ignored by
|
||||
@@ -5148,7 +5137,6 @@ class CSSTest(TestCase):
|
||||
def setUp(self):
|
||||
self.client.force_login(self.superuser)
|
||||
|
||||
@ignore_warnings(category=RemovedInDjango20Warning) # for allow_tags deprecation
|
||||
def test_field_prefix_css_classes(self):
|
||||
"""
|
||||
Fields have a CSS class name with a 'field-' prefix.
|
||||
|
||||
Reference in New Issue
Block a user