#12979 closed (fixed)
TestCase disables savepoint_commit, savepoint_rollback
Reported by: | Forest Bond | Owned by: | nobody |
---|---|---|---|
Component: | Testing framework | Version: | dev |
Severity: | Keywords: | ||
Cc: | Forest Bond | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
TestCase uses transactions to speed up tests. This is reasonable, well-documented behavior.
However, there is no benefit in disabling savepoint_commit and savepoint_rollback. With these functions disabled, there is no way to recover the transaction if an IntegrityError occurs.
Fixing this is trivial (I'll attach a patch).
Attachments (2)
Change History (10)
by , 15 years ago
Attachment: | django-testcase-support-savepoints.patch added |
---|
comment:1 by , 15 years ago
Has patch: | set |
---|
comment:2 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:4 by , 15 years ago
No, #12087 deals with TransactionTestCase whereas this ticket is specific to TestCase.
Russell, does my patch look okay?
comment:5 by , 15 years ago
Cc: | added |
---|
comment:6 by , 15 years ago
milestone: | → 1.3 |
---|
Prima facie, yes, it looks fine (as in, it does what it says it should). I need to have a bit more of a think about the consequences of this change, but on first inspection, it seems reasonable.
by , 14 years ago
Attachment: | django-test-savepoints.diff added |
---|
Includes the removal of a TransactionTestCase.
comment:7 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patch