mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #25388 -- Added an option to allow disabling of migrations during test database creation
This commit is contained in:
committed by
Markus Holtermann
parent
1243fdf5cb
commit
157d7f1f1d
@@ -2,7 +2,7 @@ from __future__ import unicode_literals
|
||||
|
||||
from unittest import skipIf
|
||||
|
||||
from django.db import connection, connections
|
||||
from django.db import ConnectionHandler, connection, connections
|
||||
from django.db.migrations.exceptions import AmbiguityError, NodeNotFoundError
|
||||
from django.db.migrations.loader import MigrationLoader
|
||||
from django.db.migrations.recorder import MigrationRecorder
|
||||
@@ -202,6 +202,23 @@ class LoaderTests(TestCase):
|
||||
self.assertEqual(migration_loader.migrated_apps, set())
|
||||
self.assertEqual(migration_loader.unmigrated_apps, {'migrated_app'})
|
||||
|
||||
@override_settings(
|
||||
INSTALLED_APPS=['migrations.migrations_test_apps.migrated_app'],
|
||||
)
|
||||
def test_disable_migrations(self):
|
||||
connections = ConnectionHandler({
|
||||
'default': {
|
||||
'NAME': 'dummy',
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'TEST': {
|
||||
'MIGRATE': False,
|
||||
},
|
||||
},
|
||||
})
|
||||
migration_loader = MigrationLoader(connections['default'])
|
||||
self.assertEqual(migration_loader.migrated_apps, set())
|
||||
self.assertEqual(migration_loader.unmigrated_apps, {'migrated_app'})
|
||||
|
||||
@override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations_squashed"})
|
||||
def test_loading_squashed(self):
|
||||
"Tests loading a squashed migration"
|
||||
|
||||
Reference in New Issue
Block a user