I should also add that neither the formset nor the form report .errors
or .non_form_errors() at all.

On Oct 8, 6:15 pm, ses1984 <ses1...@gmail.com> wrote:
> I have a pretty simple form, defined below, that I am setting
> according to some initial data, and no matter what I try, I can't seem
> to get it to validate in a test.
>
> I have created some test data, which is an array with one dictionary
> element, where the dictionary corresponds to the form. If I create a
> singular from from the dictionary element, it is valid, but if I
> create a formset from the list which contains only that very same
> dictionary, it's not valid.
>
> ###
>
> class FormulaRow(forms.Form):
>     ingredient_number = forms.CharField(label="")
>     amount = forms.DecimalField(label="", max_digits=9,
> decimal_places=5)
>
> ###
>
> >>> initial = [{'amount': '1000.000', 'ingredient_number': '100'}]
> >>> initial_singular= initial[0]
> >>> form = FormulaRow(initial_singular)
> >>> form.is_valid()
> True
> >>> FormulaFormSet = formset_factory(FormulaRow)
> >>> formset = FormulaFormSet(initial=initial)
> >>> formset.is_valid()
>
> False

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to