Seems like “manage.py test” creates test database every time I run the test. Is there a way to prevent creating test database each time I run test but just truncate data (flush)?
My tables are almost about 40 tables (even for single app, not the whole project), and makes me sick every time I run test.
Depending on your needs you have a few choices:
You could write a custom test runner or adjust the default one: https://docs.djangoproject.com/en/1.6/topics/testing/advanced/#other-testing-frameworks
You could use SimpleTestCase
There are also add-ons like django-test-utils (although I’m not sure if that specific one works with modern Django versions).
Alternatively, to speed everything up, you could use SQLite’s in-memory database OR create your test database in RAM disk (like tmpfs or ramfs) – in fact this is orthogonal to using other techniques.