Opened 16 years ago
Closed 16 years ago
#9663 closed (duplicate)
save_as with inlines is broken after changeset 9297
Reported by: | Andreas Pelme | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The save_as functionality fails after revision [9297] / [9298], when using inlines.
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 < [9297], 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.
A comment in #8882 mentions this bug too (#8882 is the ticket that r9297 fixed)
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.
Attachments (2)
Change History (3)
by , 16 years ago
Attachment: | save_as_inline_tests.diff added |
---|
comment:1 by , 16 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
#9651 already reported this. Thanks for the testcases, I've noted them in the previous ticket.
Updated admin_views unit tests