summaryrefslogtreecommitdiff
path: root/tests/forms_tests/tests/test_formsets.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/forms_tests/tests/test_formsets.py')
-rw-r--r--tests/forms_tests/tests/test_formsets.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/forms_tests/tests/test_formsets.py b/tests/forms_tests/tests/test_formsets.py
index 52dfdf4044..6b82f57343 100644
--- a/tests/forms_tests/tests/test_formsets.py
+++ b/tests/forms_tests/tests/test_formsets.py
@@ -216,7 +216,7 @@ class FormsFormsetTestCase(TestCase):
def test_min_num_displaying_more_than_one_blank_form(self):
# We can also display more than 1 empty form passing min_num argument
- # to formset_factory. It will increment the extra argument
+ # to formset_factory. It will (essentially) increment the extra argument
ChoiceFormSet = formset_factory(Choice, extra=1, min_num=1)
formset = ChoiceFormSet(auto_id=False, prefix='choices')
@@ -225,6 +225,10 @@ class FormsFormsetTestCase(TestCase):
for form in formset.forms:
form_output.append(form.as_ul())
+ # Min_num forms are required; extra forms can be empty.
+ self.assertFalse(formset.forms[0].empty_permitted)
+ self.assertTrue(formset.forms[1].empty_permitted)
+
self.assertHTMLEqual('\n'.join(form_output), """<li>Choice: <input type="text" name="choices-0-choice" /></li>
<li>Votes: <input type="number" name="choices-0-votes" /></li>
<li>Choice: <input type="text" name="choices-1-choice" /></li>