ARV
ARV

Reputation: 6867

Django manage.py test - how to tell it to not create/delete test database

I am running a few test cases in Django 1.6, and everytime I run a test, it creates the test DB and deletes it at the end. This takes up a some time and is really irritating when I am iterating to find simple errors.

Is there a way I can specify to manage.py that it should not create/delete databases every time a test is run?

Upvotes: 0

Views: 1978

Answers (2)

Oleksandr Zelentsov
Oleksandr Zelentsov

Reputation: 67

as of now, it is possible, i think, with adding a keyword argument to test running:

python manage.py test --keepdb

Upvotes: 3

SunnySydeUp
SunnySydeUp

Reputation: 6790

You won't be able to with Django's default test runner. However, if you get the django-nose package, you can enable database reuse with:

REUSE_DB=1 ./manage.py test

However, you should not do this if you make any changes to your database schema.

Upvotes: 1

Related Questions