Disable migrations when running unit tests in Django 1.7

后端 未结 7 1226
一向
一向 2020-11-30 19:57

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

7条回答
  •  情话喂你
    2020-11-30 20:54

    https://gist.github.com/apollovy/22826f493ad2d06d9a9a22464730ce0b

    MIGRATION_MODULES = {
        app[app.rfind('.') + 1:]: 'my_app.migrations_not_used_in_tests'
        for app in INSTALLED_APPS
    }
    

提交回复
热议问题