Thursday, March 18, 2010

Re: ManagementForm validation error in unit test

Mystery solved. Thanks for your help, and sorry for the waste of time, but the problem was that I missed a previous form submission in the same test function, that was used just to test validation. I hadn't added the ManagementForm variables there, so that was the problem.

Best regards,
Paulo

On Thu, Mar 18, 2010 at 5:18 PM, raj <rajeeshrnair@gmail.com> wrote:

> This works, but if I leave out the prefix in the last command then the same
> ValidationError is raised.

You've almost worked it out yourself. This error usually occurs when
the given prefix does not match with what django expected. When you
don't provide any prefix argument on generating formset, django
expects the default prefix. Try ImageFormset.get_default_prefix() to
get that value and use it in your data dictionary



Rajeesh.

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


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

No comments:

Post a Comment