mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Refs #34380 -- Added FORMS_URLFIELD_ASSUME_HTTPS transitional setting.
This allows early adoption of the new default "https".
This commit is contained in:
@@ -2930,7 +2930,8 @@ class ModelOtherFieldTests(SimpleTestCase):
|
||||
msg = (
|
||||
"The default scheme will be changed from 'http' to 'https' in Django "
|
||||
"6.0. Pass the forms.URLField.assume_scheme argument to silence this "
|
||||
"warning."
|
||||
"warning, or set the FORMS_URLFIELD_ASSUME_HTTPS transitional setting to "
|
||||
"True to opt into using 'https' as the new default scheme."
|
||||
)
|
||||
with self.assertWarnsMessage(RemovedInDjango60Warning, msg):
|
||||
|
||||
@@ -2939,6 +2940,18 @@ class ModelOtherFieldTests(SimpleTestCase):
|
||||
model = Homepage
|
||||
fields = "__all__"
|
||||
|
||||
def test_url_modelform_assume_scheme_early_adopt_https(self):
|
||||
msg = "The FORMS_URLFIELD_ASSUME_HTTPS transitional setting is deprecated."
|
||||
with (
|
||||
self.assertWarnsMessage(RemovedInDjango60Warning, msg),
|
||||
self.settings(FORMS_URLFIELD_ASSUME_HTTPS=True),
|
||||
):
|
||||
|
||||
class HomepageForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Homepage
|
||||
fields = "__all__"
|
||||
|
||||
def test_modelform_non_editable_field(self):
|
||||
"""
|
||||
When explicitly including a non-editable field in a ModelForm, the
|
||||
|
||||
Reference in New Issue
Block a user