diff options
| author | SaJH <wogur981208@gmail.com> | 2025-08-18 23:40:54 +0900 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2025-08-25 10:05:45 +0200 |
| commit | 3ba24c18e70dd242ae237fd955fb8be30f99bc4d (patch) | |
| tree | 8b65f66c4c8776c3f0b1315fdca5fef7ecaff494 /tests/model_formsets | |
| parent | 165ad74c578f94f962624a40dff14e1b2e23a1f8 (diff) | |
Fixed #36251 -- Avoided mutating form Meta.fields in BaseInlineFormSet.
Signed-off-by: SaJH <wogur981208@gmail.com>
Diffstat (limited to 'tests/model_formsets')
| -rw-r--r-- | tests/model_formsets/tests.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/model_formsets/tests.py b/tests/model_formsets/tests.py index 7722d2b3d6..cd60795fc8 100644 --- a/tests/model_formsets/tests.py +++ b/tests/model_formsets/tests.py @@ -1687,9 +1687,10 @@ class ModelFormsetTest(TestCase): class Meta: model = Book - fields = ("title",) + fields = ["title"] BookFormSet = inlineformset_factory(Author, Book, form=BookForm) + self.assertEqual(BookForm.Meta.fields, ["title"]) data = { "book_set-TOTAL_FORMS": "3", "book_set-INITIAL_FORMS": "0", @@ -1700,6 +1701,7 @@ class ModelFormsetTest(TestCase): } author = Author.objects.create(name="test") formset = BookFormSet(data, instance=author) + self.assertEqual(BookForm.Meta.fields, ["title"]) self.assertEqual( formset.errors, [{}, {"__all__": ["Please correct the duplicate values below."]}, {}], |
