Loading django/db/migrations/loader.py +4 −2 Original line number Diff line number Diff line Loading @@ -48,8 +48,10 @@ class MigrationLoader(object): if load: self.build_graph() @classmethod def migrations_module(cls, app_label): def migrations_module(self, app_label): if (self.connection is not None and not self.connection.settings_dict.get('TEST', {}).get('MIGRATE', True)): return None if app_label in settings.MIGRATION_MODULES: return settings.MIGRATION_MODULES[app_label] else: Loading django/db/migrations/questioner.py +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ class MigrationQuestioner(object): app_config = apps.get_app_config(app_label) except LookupError: # It's a fake app. return self.defaults.get("ask_initial", False) migrations_import_path = MigrationLoader.migrations_module(app_config.label) migrations_import_path = MigrationLoader(None, load=False).migrations_module(app_config.label) if migrations_import_path is None: # It's an application with migrations disabled. return self.defaults.get("ask_initial", False) Loading django/db/migrations/writer.py +1 −1 Original line number Diff line number Diff line Loading @@ -221,7 +221,7 @@ class MigrationWriter(object): @property def basedir(self): migrations_package_name = MigrationLoader.migrations_module(self.migration.app_label) migrations_package_name = MigrationLoader(None, load=False).migrations_module(self.migration.app_label) if migrations_package_name is None: raise ValueError( Loading docs/ref/settings.txt +11 −0 Original line number Diff line number Diff line Loading @@ -710,6 +710,17 @@ The creation-order dependencies of the database. See the documentation on :ref:`controlling the creation order of test databases <topics-testing-creation-dependencies>` for details. .. setting:: TEST_MIGRATE ``MIGRATE`` ^^^^^^^^^^^ .. versionadded:: 1.10 Default: ``True`` If set to ``False``, Django won't use migrations to create the test database. .. setting:: TEST_MIRROR ``MIRROR`` Loading docs/releases/1.10.txt +3 −0 Original line number Diff line number Diff line Loading @@ -394,6 +394,9 @@ Tests and run selectively with the new :option:`test --tag` and :option:`test --exclude-tag` options. * Added the :setting:`DATABASES['TEST']['MIGRATE'] <TEST_MIGRATE>` option to allow disabling of migrations during test database creation. URLs ~~~~ Loading Loading
django/db/migrations/loader.py +4 −2 Original line number Diff line number Diff line Loading @@ -48,8 +48,10 @@ class MigrationLoader(object): if load: self.build_graph() @classmethod def migrations_module(cls, app_label): def migrations_module(self, app_label): if (self.connection is not None and not self.connection.settings_dict.get('TEST', {}).get('MIGRATE', True)): return None if app_label in settings.MIGRATION_MODULES: return settings.MIGRATION_MODULES[app_label] else: Loading
django/db/migrations/questioner.py +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ class MigrationQuestioner(object): app_config = apps.get_app_config(app_label) except LookupError: # It's a fake app. return self.defaults.get("ask_initial", False) migrations_import_path = MigrationLoader.migrations_module(app_config.label) migrations_import_path = MigrationLoader(None, load=False).migrations_module(app_config.label) if migrations_import_path is None: # It's an application with migrations disabled. return self.defaults.get("ask_initial", False) Loading
django/db/migrations/writer.py +1 −1 Original line number Diff line number Diff line Loading @@ -221,7 +221,7 @@ class MigrationWriter(object): @property def basedir(self): migrations_package_name = MigrationLoader.migrations_module(self.migration.app_label) migrations_package_name = MigrationLoader(None, load=False).migrations_module(self.migration.app_label) if migrations_package_name is None: raise ValueError( Loading
docs/ref/settings.txt +11 −0 Original line number Diff line number Diff line Loading @@ -710,6 +710,17 @@ The creation-order dependencies of the database. See the documentation on :ref:`controlling the creation order of test databases <topics-testing-creation-dependencies>` for details. .. setting:: TEST_MIGRATE ``MIGRATE`` ^^^^^^^^^^^ .. versionadded:: 1.10 Default: ``True`` If set to ``False``, Django won't use migrations to create the test database. .. setting:: TEST_MIRROR ``MIRROR`` Loading
docs/releases/1.10.txt +3 −0 Original line number Diff line number Diff line Loading @@ -394,6 +394,9 @@ Tests and run selectively with the new :option:`test --tag` and :option:`test --exclude-tag` options. * Added the :setting:`DATABASES['TEST']['MIGRATE'] <TEST_MIGRATE>` option to allow disabling of migrations during test database creation. URLs ~~~~ Loading