summaryrefslogtreecommitdiff
path: root/tests/forms_tests
diff options
context:
space:
mode:
authorDevilsAutumn <bhuvnesh875@gmail.com>2022-09-09 15:21:41 +0530
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-09-09 13:51:47 +0200
commitf3cd252cfc46c0c7d66e765818dd3dadf60d4d0e (patch)
tree6f5fd953b39c962c1d051b833b92fbae03eab875 /tests/forms_tests
parent6df9398cce063874ae4d59db126d4adacb0fa8d3 (diff)
downloaddjango-f3cd252cfc46c0c7d66e765818dd3dadf60d4d0e.tar.gz
Fixed #33995 -- Fixed FormSet.empty_form crash when empty_permitted is passed to form_kwargs.
Diffstat (limited to 'tests/forms_tests')
-rw-r--r--tests/forms_tests/tests/test_formsets.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/forms_tests/tests/test_formsets.py b/tests/forms_tests/tests/test_formsets.py
index c36a79d4e0..f0e4b154b7 100644
--- a/tests/forms_tests/tests/test_formsets.py
+++ b/tests/forms_tests/tests/test_formsets.py
@@ -179,6 +179,10 @@ class FormsFormsetTestCase(SimpleTestCase):
self.assertTrue(hasattr(formset.empty_form, "custom_kwarg"))
self.assertEqual(formset.empty_form.custom_kwarg, 1)
+ def test_empty_permitted_ignored_empty_form(self):
+ formset = ArticleFormSet(form_kwargs={"empty_permitted": False})
+ self.assertIs(formset.empty_form.empty_permitted, True)
+
def test_formset_validation(self):
# FormSet instances can also have an error attribute if validation failed for
# any of the forms.