1
0
mirror of https://github.com/django/django.git synced 2025-10-27 23:56:08 +00:00

Fixed #34380 -- Allowed specifying a default URL scheme in forms.URLField.

This also deprecates "http" as the default scheme.
This commit is contained in:
Coen van der Kamp
2023-03-08 20:12:34 +01:00
committed by Mariusz Felisiak
parent 070cbac0db
commit 7bbbadc693
10 changed files with 132 additions and 20 deletions

View File

@@ -26,6 +26,7 @@ from django.forms.utils import ErrorList
from django.template.response import TemplateResponse
from django.test import (
TestCase,
ignore_warnings,
modify_settings,
override_settings,
skipUnlessDBFeature,
@@ -34,6 +35,7 @@ from django.test.utils import override_script_prefix
from django.urls import NoReverseMatch, resolve, reverse
from django.utils import formats, translation
from django.utils.cache import get_max_age
from django.utils.deprecation import RemovedInDjango60Warning
from django.utils.encoding import iri_to_uri
from django.utils.html import escape
from django.utils.http import urlencode
@@ -6555,6 +6557,7 @@ class ReadonlyTest(AdminFieldExtractionMixin, TestCase):
def setUp(self):
self.client.force_login(self.superuser)
@ignore_warnings(category=RemovedInDjango60Warning)
def test_readonly_get(self):
response = self.client.get(reverse("admin:admin_views_post_add"))
self.assertNotContains(response, 'name="posted"')
@@ -6615,6 +6618,7 @@ class ReadonlyTest(AdminFieldExtractionMixin, TestCase):
)
self.assertContains(response, "%d amount of cool" % p.pk)
@ignore_warnings(category=RemovedInDjango60Warning)
def test_readonly_text_field(self):
p = Post.objects.create(
title="Readonly test",
@@ -6634,6 +6638,7 @@ class ReadonlyTest(AdminFieldExtractionMixin, TestCase):
# Checking readonly field in inline.
self.assertContains(response, "test<br>link")
@ignore_warnings(category=RemovedInDjango60Warning)
def test_readonly_post(self):
data = {
"title": "Django Got Readonly Fields",
@@ -6774,6 +6779,7 @@ class ReadonlyTest(AdminFieldExtractionMixin, TestCase):
field = self.get_admin_readonly_field(response, "plotdetails")
self.assertEqual(field.contents(), "-") # default empty value
@ignore_warnings(category=RemovedInDjango60Warning)
def test_readonly_field_overrides(self):
"""
Regression test for #22087 - ModelForm Meta overrides are ignored by
@@ -7233,6 +7239,7 @@ class CSSTest(TestCase):
def setUp(self):
self.client.force_login(self.superuser)
@ignore_warnings(category=RemovedInDjango60Warning)
def test_field_prefix_css_classes(self):
"""
Fields have a CSS class name with a 'field-' prefix.