#18347 closed Bug (fixed)
Unit tests contain raw inserts to an identity column
Reported by: | Michael Manfre | Owned by: | Anssi Kääriäinen |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Normal | Keywords: | identity insert, mssql |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
Two unit tests in transactions_regress.TestTransactionClosing fail for MSSQL because of raw inserts in to an identity column. MSSQL and potentially other 3rd party backends require actions to allow this type of insert.
Change History (10)
comment:1 by , 13 years ago
Easy pickings: | set |
---|---|
Has patch: | set |
comment:2 by , 12 years ago
Triage Stage: | Unreviewed → Accepted |
---|
The patch looks pretty good to me.
However, wouldn't it be just as easy to not include the primary key in the inserted values in these two tests? I wouldn't like to expand the database backend API more than necessary.
comment:3 by , 12 years ago
An alternate patch which just removes inserts into the primary key field. Would this work for mssql? If not, then adding a new model without autofield primary key is still one possibility.
comment:5 by , 12 years ago
Owner: | changed from | to
---|
Passing ownership because your patch works for django-mssql
comment:6 by , 12 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Patch from akaariai works, tests pass also for PostgreSQL and SQLite3 (if test is not skipped).
comment:8 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Pull request https://github.com/manfre/django/commit/06d8aee7edc1ff2862ad8c64d1097090df46fdfa
Implementation followed the paradigm used by enable/disable constraints.