1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #12878. Formset-wide errors are now rendered properly as html.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12548 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Joseph Kocherhans
2010-02-23 20:55:42 +00:00
parent c8fa110093
commit ea3853e8d2
3 changed files with 34 additions and 1 deletions

View File

@@ -621,4 +621,20 @@ Make sure the management form has the correct prefix.
>>> formset.management_form.prefix
'form'
# Regression test for #12878 #################################################
>>> data = {
... 'drinks-TOTAL_FORMS': '2', # the number of forms rendered
... 'drinks-INITIAL_FORMS': '0', # the number of forms with initial data
... 'drinks-MAX_NUM_FORMS': '0', # max number of forms
... 'drinks-0-name': 'Gin and Tonic',
... 'drinks-1-name': 'Gin and Tonic',
... }
>>> formset = FavoriteDrinksFormSet(data, prefix='drinks')
>>> formset.is_valid()
False
>>> print formset.non_form_errors()
<ul class="errorlist"><li>You may only specify a drink once.</li></ul>
"""