Fixed isolation of test_migrate_fake_split_initial.
This commit is contained in:
parent
8b2a30f6f1
commit
ada83fd8b8
|
@ -229,18 +229,20 @@ class MigrateTests(MigrationTestBase):
|
||||||
"""
|
"""
|
||||||
Split initial migrations can be faked with --fake-initial.
|
Split initial migrations can be faked with --fake-initial.
|
||||||
"""
|
"""
|
||||||
call_command("migrate", "migrations", "0002", verbosity=0)
|
try:
|
||||||
call_command("migrate", "migrations", "zero", fake=True, verbosity=0)
|
call_command('migrate', 'migrations', '0002', verbosity=0)
|
||||||
out = io.StringIO()
|
call_command('migrate', 'migrations', 'zero', fake=True, verbosity=0)
|
||||||
with mock.patch('django.core.management.color.supports_color', lambda *args: False):
|
out = io.StringIO()
|
||||||
call_command("migrate", "migrations", "0002", fake_initial=True, stdout=out, verbosity=1)
|
with mock.patch('django.core.management.color.supports_color', lambda *args: False):
|
||||||
value = out.getvalue().lower()
|
call_command('migrate', 'migrations', '0002', fake_initial=True, stdout=out, verbosity=1)
|
||||||
self.assertIn("migrations.0001_initial... faked", value)
|
value = out.getvalue().lower()
|
||||||
self.assertIn("migrations.0002_second... faked", value)
|
self.assertIn('migrations.0001_initial... faked', value)
|
||||||
# Fake an apply
|
self.assertIn('migrations.0002_second... faked', value)
|
||||||
call_command("migrate", "migrations", fake=True, verbosity=0)
|
finally:
|
||||||
# Unmigrate everything
|
# Fake an apply.
|
||||||
call_command("migrate", "migrations", "zero", verbosity=0)
|
call_command('migrate', 'migrations', fake=True, verbosity=0)
|
||||||
|
# Unmigrate everything.
|
||||||
|
call_command('migrate', 'migrations', 'zero', verbosity=0)
|
||||||
|
|
||||||
@override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations_conflict"})
|
@override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations_conflict"})
|
||||||
def test_migrate_conflict_exit(self):
|
def test_migrate_conflict_exit(self):
|
||||||
|
|
Loading…
Reference in New Issue