Django unit test without creating test database every time I run

From Django 1.8 on you could use the –keepdb flag, when calling the manage.py

New in Django 1.8: You can prevent the test databases from being
destroyed by adding the –keepdb flag to the test command. This will
preserve the test database between runs. If the database does not
exist, it will first be created. Any migrations will also be applied
in order to keep it up to date.
(https://docs.djangoproject.com/en/1.8/topics/testing/overview/#the-test-database)

So your call could look as follows:

python manage.py test --keepdb

Or using the shorthand -k it could look like that:

python manage.py test -k

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)