Testing admin inlines painful to debug ("ManagementForm data is missing or has been tampered with")

122 views
Skip to first unread message

Federico Capoano

unread,
Nov 15, 2017, 9:48:19 AM11/15/17
to Django developers (Contributions to Django itself)
While writing tests for the admin, I'm clashing with this error message:

"ManagementForm data is missing or has been tampered with".

It's not the first time I do this, but every time the process has been extremely painful because the error message doesn't point out the exact problem.
This time I'm pretty sure to have done everything properly but I just can't find out what's missing, not even by dropping pdb.set_trace() into django's internal code.

I'm wondering if we can improve this error message so that if DEBUG is True we can have some more information about what is missing.

Would that be possible and welcome?

Best regards
Federico

Jesse Welborn

unread,
Dec 24, 2017, 2:46:45 PM12/24/17
to Django developers (Contributions to Django itself)
I had a similar issue trying to debug InlineModelFormsets. If the root cause is the same I have a PR open to add documentation relating to how Inline Formets deal with prefixes.

Without knowing your specific circumstance it's impossible to know if this is the cause, but if so it was a pain point for me as well.

Regard,
JW
Reply all
Reply to author
Forward
0 new messages