Django's unit test system wipes out "custom sql" data before performing tests
|Reported by:||deltoide||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Django's unit test system issues "flush" command (resulting in a truncate for all tables) just before performing tests. This causes problems when having custom sql scripts (<appname>/sql/<modelname>.sql) because all this data is wiped out by the truncate and might be required for the tests.
Django's test execution path:
- tables creation
- custom sql execution (potential data insertion)
- flush (truncate all tables)
- perform tests (without potential custom sql data!)
I think it might be good to execute custom sql after the truncate has occurred ...