Fixed #22661 -- Move makemigrations tests to the proper class
This commit is contained in:
parent
ba5ddf7aed
commit
44304cf04e
|
@ -85,28 +85,6 @@ class MigrateTests(MigrationTestBase):
|
||||||
with self.assertRaises(CommandError):
|
with self.assertRaises(CommandError):
|
||||||
call_command("migrate", "migrations")
|
call_command("migrate", "migrations")
|
||||||
|
|
||||||
@override_system_checks([])
|
|
||||||
@override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations_conflict"})
|
|
||||||
def test_makemigrations_conflict_exit(self):
|
|
||||||
"""
|
|
||||||
Makes sure that makemigrations exits if it detects a conflict.
|
|
||||||
"""
|
|
||||||
with self.assertRaises(CommandError):
|
|
||||||
call_command("makemigrations")
|
|
||||||
|
|
||||||
@override_system_checks([])
|
|
||||||
@override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations_conflict"})
|
|
||||||
def test_makemigrations_merge_basic(self):
|
|
||||||
"""
|
|
||||||
Makes sure that makemigrations doesn't error if you ask for
|
|
||||||
merge mode with a conflict present. Doesn't test writing of the merge
|
|
||||||
file, as that requires temp directories.
|
|
||||||
"""
|
|
||||||
try:
|
|
||||||
call_command("makemigrations", merge=True, verbosity=0)
|
|
||||||
except CommandError:
|
|
||||||
self.fail("Makemigrations errored in merge mode with conflicts")
|
|
||||||
|
|
||||||
@override_system_checks([])
|
@override_system_checks([])
|
||||||
@override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations"})
|
@override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations"})
|
||||||
def test_sqlmigrate(self):
|
def test_sqlmigrate(self):
|
||||||
|
@ -211,3 +189,25 @@ class MakeMigrationsTests(MigrationTestBase):
|
||||||
|
|
||||||
initial_file = os.path.join(self.migration_dir, "0001_initial.py")
|
initial_file = os.path.join(self.migration_dir, "0001_initial.py")
|
||||||
self.assertFalse(os.path.exists(initial_file))
|
self.assertFalse(os.path.exists(initial_file))
|
||||||
|
|
||||||
|
@override_system_checks([])
|
||||||
|
@override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations_conflict"})
|
||||||
|
def test_makemigrations_conflict_exit(self):
|
||||||
|
"""
|
||||||
|
Makes sure that makemigrations exits if it detects a conflict.
|
||||||
|
"""
|
||||||
|
with self.assertRaises(CommandError):
|
||||||
|
call_command("makemigrations")
|
||||||
|
|
||||||
|
@override_system_checks([])
|
||||||
|
@override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations_conflict"})
|
||||||
|
def test_makemigrations_merge_basic(self):
|
||||||
|
"""
|
||||||
|
Makes sure that makemigrations doesn't error if you ask for
|
||||||
|
merge mode with a conflict present. Doesn't test writing of the merge
|
||||||
|
file, as that requires temp directories.
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
call_command("makemigrations", merge=True, verbosity=0)
|
||||||
|
except CommandError:
|
||||||
|
self.fail("Makemigrations errored in merge mode with conflicts")
|
||||||
|
|
Loading…
Reference in New Issue