save_as with inlines is broken after changeset 9297
|Reported by:||peritus||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I have attached a patch with a updated admin_views test to include CHILD_set-N-PARENT for the ordinary change_form edit test, and I also added a test for save_as in the same test.
The test succeeds for revisions < , since it simply does not care about the FK field.
It might be suitable for better tests for the formsets themselves, but I am not quite sure how to test them properly.
If you like to test this manually, outside of the testsuite, I have also attached a test project with a sqlite database which can be used to test the bug right away:
- Admin login: test / test
- Open the existing "Parent"-object (change form) and hit "Save as new" without changing any fields.
- The first error is "Please correct the errors below."
- If you hit "Save" again, a KeyError will be raised and unhandled.
The unittest in the patch does *NOT* test for the KeyError-exception, since I am not sure if that is the proper thing to do here, or if that is related to this issue at all.
This bug affects both the 1.0.X branch and trunk.