1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #34051 -- Made makemigrations --check exit before making migrations.

This commit is contained in:
Jacob Walls
2022-09-25 19:53:55 -04:00
committed by Mariusz Felisiak
parent 5d36a8266c
commit 80d38de52b
4 changed files with 16 additions and 4 deletions

View File

@@ -2391,9 +2391,10 @@ class MakeMigrationsTests(MigrationTestBase):
makemigrations --check should exit with a non-zero status when
there are changes to an app requiring migrations.
"""
with self.temporary_migration_module():
with self.temporary_migration_module() as tmpdir:
with self.assertRaises(SystemExit):
call_command("makemigrations", "--check", "migrations", verbosity=0)
self.assertFalse(os.path.exists(tmpdir))
with self.temporary_migration_module(
module="migrations.test_migrations_no_changes"