summaryrefslogtreecommitdiff
path: root/tests/model_formsets
diff options
context:
space:
mode:
authordjango-bot <ops@djangoproject.com>2025-07-22 20:41:41 -0700
committernessita <124304+nessita@users.noreply.github.com>2025-07-23 20:17:55 -0300
commit69a93a88edb56ba47f624dac7a21aacc47ea474f (patch)
treef57507a4435d032493cae40e06ecb254790b67b2 /tests/model_formsets
parent55b0cc21310b76ce4018dd793ba50556eaf0af06 (diff)
Refs #36500 -- Rewrapped long docstrings and block comments via a script.
Rewrapped long docstrings and block comments to 79 characters + newline using script from https://github.com/medmunds/autofix-w505.
Diffstat (limited to 'tests/model_formsets')
-rw-r--r--tests/model_formsets/models.py3
-rw-r--r--tests/model_formsets/tests.py22
2 files changed, 14 insertions, 11 deletions
diff --git a/tests/model_formsets/models.py b/tests/model_formsets/models.py
index a2965395d6..397bf9de53 100644
--- a/tests/model_formsets/models.py
+++ b/tests/model_formsets/models.py
@@ -195,7 +195,8 @@ class Player(models.Model):
return self.name
-# Models for testing custom ModelForm save methods in formsets and inline formsets
+# Models for testing custom ModelForm save methods in formsets and inline
+# formsets
class Poet(models.Model):
name = models.CharField(max_length=100)
diff --git a/tests/model_formsets/tests.py b/tests/model_formsets/tests.py
index 748e5f5018..7722d2b3d6 100644
--- a/tests/model_formsets/tests.py
+++ b/tests/model_formsets/tests.py
@@ -104,8 +104,8 @@ class DeletionTests(TestCase):
def test_change_form_deletion_when_invalid(self):
"""
- Make sure that a change form that is filled out, but marked for deletion
- doesn't cause validation errors.
+ Make sure that a change form that is filled out, but marked for
+ deletion doesn't cause validation errors.
"""
PoetFormSet = modelformset_factory(Poet, fields="__all__", can_delete=True)
poet = Poet.objects.create(name="test")
@@ -1538,8 +1538,8 @@ class ModelFormsetTest(TestCase):
],
)
- # unique_together with inlineformset_factory with overridden form fields
- # Also see #9494
+ # unique_together with inlineformset_factory with overridden form
+ # fields Also see #9494
FormSet = inlineformset_factory(
Repository, Revision, fields=("revision",), extra=1
@@ -1564,9 +1564,10 @@ class ModelFormsetTest(TestCase):
)
formset = FormSet(instance=person)
- # Django will render a hidden field for model fields that have a callable
- # default. This is required to ensure the value is tested for change correctly
- # when determine what extra forms have changed to save.
+ # Django will render a hidden field for model fields that have a
+ # callable default. This is required to ensure the value is tested for
+ # change correctly when determine what extra forms have changed to
+ # save.
self.assertEqual(len(formset.forms), 1) # this formset only has one form
form = formset.forms[0]
@@ -1594,7 +1595,8 @@ class ModelFormsetTest(TestCase):
'id="id_membership_set-0-id"></p>' % person.id,
)
- # test for validation with callable defaults. Validations rely on hidden fields
+ # test for validation with callable defaults. Validations rely on
+ # hidden fields
data = {
"membership_set-TOTAL_FORMS": "1",
@@ -1728,8 +1730,8 @@ class ModelFormsetTest(TestCase):
)
def test_model_formset_with_custom_pk(self):
- # a formset for a Model that has a custom primary key that still needs to be
- # added to the formset automatically
+ # a formset for a Model that has a custom primary key that still needs
+ # to be added to the formset automatically
FormSet = modelformset_factory(
ClassyMexicanRestaurant, fields=["tacos_are_yummy"]
)