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
Hi Rajeesh,
Thanks for the reply, but I still didn't manage to make it work. On the one
hand, I couldn't find the get_default_prefix function (I'm using Django
1.02, which may explain that), but on the other hand, I do provide a prefix
argument when I generate the formset, in my view:
> 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
> ValidationError: [u'ManagementForm data is missing or has been tampered
> with']
> >> formset = ImageFormset(data,prefix='image_form')
>
> This works, but if I leave out the prefix in the last command then the same
> ValidationError is raised.
You've almost found it yourself. When you don't
Hi,
I have a function in tests.py that tests the editing of a form, and it
worked fine until I added an inline formset to the form. Now it fails with
this error:
ValidationError: [u'ManagementForm data is missing or has been tampered
with']
I added these lines to the test function:
5 matches
Mail list logo