1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +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

@@ -22,9 +22,10 @@ from django.db.models import (
ManyToManyField,
UUIDField,
)
from django.test import SimpleTestCase, TestCase, override_settings
from django.test import SimpleTestCase, TestCase, ignore_warnings, override_settings
from django.urls import reverse
from django.utils import translation
from django.utils.deprecation import RemovedInDjango60Warning
from .models import (
Advisor,
@@ -106,6 +107,7 @@ class AdminFormfieldForDBFieldTests(SimpleTestCase):
def test_TextField(self):
self.assertFormfield(Event, "description", widgets.AdminTextareaWidget)
@ignore_warnings(category=RemovedInDjango60Warning)
def test_URLField(self):
self.assertFormfield(Event, "link", widgets.AdminURLFieldWidget)
@@ -320,6 +322,7 @@ class AdminForeignKeyRawIdWidget(TestDataMixin, TestCase):
def setUp(self):
self.client.force_login(self.superuser)
@ignore_warnings(category=RemovedInDjango60Warning)
def test_nonexistent_target_id(self):
band = Band.objects.create(name="Bogey Blues")
pk = band.pk
@@ -335,6 +338,7 @@ class AdminForeignKeyRawIdWidget(TestDataMixin, TestCase):
"Select a valid choice. That choice is not one of the available choices.",
)
@ignore_warnings(category=RemovedInDjango60Warning)
def test_invalid_target_id(self):
for test_str in ("Iñtërnâtiônàlizætiøn", "1234'", -1234):
# This should result in an error message, not a server exception.
@@ -1610,6 +1614,7 @@ class HorizontalVerticalFilterSeleniumTests(AdminWidgetSeleniumTestCase):
self.assertCountSeleniumElements("#id_students_to > option", 2)
@ignore_warnings(category=RemovedInDjango60Warning)
class AdminRawIdWidgetSeleniumTests(AdminWidgetSeleniumTestCase):
def setUp(self):
super().setUp()