From 44304cf04e46cf7fa974571efd24716e03e05f94 Mon Sep 17 00:00:00 2001 From: Huu Nguyen Date: Mon, 19 May 2014 20:16:36 -0700 Subject: [PATCH] Fixed #22661 -- Move makemigrations tests to the proper class --- tests/migrations/test_commands.py | 44 +++++++++++++++---------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/tests/migrations/test_commands.py b/tests/migrations/test_commands.py index 129e80b92c..c612b3812e 100644 --- a/tests/migrations/test_commands.py +++ b/tests/migrations/test_commands.py @@ -85,28 +85,6 @@ class MigrateTests(MigrationTestBase): with self.assertRaises(CommandError): 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_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations"}) def test_sqlmigrate(self): @@ -211,3 +189,25 @@ class MakeMigrationsTests(MigrationTestBase): initial_file = os.path.join(self.migration_dir, "0001_initial.py") 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")