[Fixed]-How do I tell Django to save my test database?


In django1.8 added new parameter for manage.py test command –keepdb

./manage.py test --keepdb


Have you tried using an in-memory SQLite database for tests? It’s much faster than using a disk-based database.


I’m using Djang-nose. If you set a env var REUSE_DB=1 it will not destroy the DB after running tests and re-use that same DB for the next run. Whenever your schema changes, just set REUSE_DB=0 and do one ‘full’ run. After that reset it to 1 and you’re good to go.


Leave a comment