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

23👍

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

./manage.py test --keepdb

4👍

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

1👍

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.

https://github.com/django-nose/django-nose

Leave a comment