summaryrefslogtreecommitdiff
path: root/tests/regressiontests/forms/formsets.py
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2009-04-28 14:17:18 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2009-04-28 14:17:18 +0000
commit2ba9df2f41cd649b42f5d7452aa2393aa6131f32 (patch)
tree86877b1705242e37916bc9fd3fbba1f794a3fb7f /tests/regressiontests/forms/formsets.py
parent0c1d38bdf4884121e322c557e09721af85c10eb3 (diff)
Fixed #10082 -- Modified BaseFormSet so that ordering checks work when the formset is empty. Thanks to Petr Marhoun for the report and test case, and bmathieu for the fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10643 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/forms/formsets.py')
-rw-r--r--tests/regressiontests/forms/formsets.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/regressiontests/forms/formsets.py b/tests/regressiontests/forms/formsets.py
index c3c89d078d..dd2b188fd2 100644
--- a/tests/regressiontests/forms/formsets.py
+++ b/tests/regressiontests/forms/formsets.py
@@ -394,6 +394,18 @@ True
{'votes': 500, 'ORDER': None, 'choice': u'The Decemberists'}
{'votes': 50, 'ORDER': None, 'choice': u'Basia Bulat'}
+Ordering should work with blank fieldsets.
+
+>>> data = {
+... 'choices-TOTAL_FORMS': '3', # the number of forms rendered
+... 'choices-INITIAL_FORMS': '0', # the number of forms with initial data
+... }
+
+>>> formset = ChoiceFormSet(data, auto_id=False, prefix='choices')
+>>> formset.is_valid()
+True
+>>> for form in formset.ordered_forms:
+... print form.cleaned_data
# FormSets with ordering + deletion ###########################################