Django 1.7 introduced database migrations.
When running the unit tests in Django 1.7, it forces a migrate, that takes a long time. So I woul
For django 1.9 and up the answer of Guillaume Vincent does not work anymore, so here's a new solution:
I'm using this snippet in my settings file, after the definition of the INSTALLED_APPS
if os.environ.get('TESTS_WITHOUT_MIGRATIONS', False):
MIGRATION_MODULES = {
app.split('.')[-1]: None for app in INSTALLED_APPS
}
It iterates over all installed apps and marks each as having no migration module. See the django docs for more information.
Using this snippet you can run your tests, setting the environment variable TESTS_WITHOUT_MIGRATIONS, e.g.:
TESTS_WITHOUT_MIGRATIONS=1 ./manage.py test