Make TransactionTestCase flush tables after test run instead of before
|Reported by:||andreas_pelme||Owned by:||nobody|
|Cc:||Triage Stage:||Design decision needed|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
TransactionTestCase does not clean up after a test is run. When the next TransactionTestCase is run, tables are flushed and fixtures are loaded.
It would be better if the flush took place in _post_teardown, which would leave the database in a clean state after each test. Then test order does not matter, TransactionTestCase and TestCases can be executed in arbitrary order.
There is a related ticket #12408 to reorder doctests to also run before TransactionTestCase. If TransactionTestCase is changed, no reordering will be necessary.
django-developers discussion: http://groups.google.com/group/django-developers/browse_thread/thread/3df2b4926eba08d2?hl=en
Change History (3)
comment:1 Changed 3 years ago by andreas_pelme
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:2 Changed 3 years ago by akaariai
- Component changed from Uncategorized to Testing framework
- Triage Stage changed from Unreviewed to Design decision needed