Opened 13 years ago
Closed 11 years ago
#18320 closed Bug (worksforme)
Unit test model_formsets_regress.FormsetTests.test_extraneous_query_is_not_run expects wrong number of queries
Reported by: | Michael Manfre | Owned by: | nobody |
---|---|---|---|
Component: | Testing framework | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
For database backends with feature can_return_id_from_insert = False
, there should be an expected second query, which fetches the newly inserted pk.
Attachments (2)
Change History (7)
by , 13 years ago
Attachment: | django-ticket18320.diff added |
---|
comment:1 by , 13 years ago
Triage Stage: | Unreviewed → Accepted |
---|
Looks good. But why does this test not fail on any of core backends?
Not marking as RFC as I haven't actually applied the patch.
comment:2 by , 13 years ago
Patch needs improvement: | set |
---|
You raised a valid question. can_return_id_from_insert = False does not necessarily imply that a separate query is needed to fetch the return_id. Updating patch pending.
by , 13 years ago
Attachment: | django-ticket18320.2.diff added |
---|
Added feature 'query_needed_to_fetch_return_id'
comment:3 by , 13 years ago
Patch needs improvement: | unset |
---|
The other backends are able to pull the insert id from the cursor without an additional query.
comment:4 by , 11 years ago
Is this still desired or did you find another solution in the past 2 years? It looks like it was just forgotten.
comment:5 by , 11 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
I found another solution and forgot about this case. Closing.
Check conection features to determine proper num of expected queries.