summaryrefslogtreecommitdiff
path: root/tests/migrations
diff options
context:
space:
mode:
authorJunKi Yoon <na66421@gmail.com>2022-09-27 21:10:18 +0900
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-09-27 21:10:30 +0200
commit1a7b6909ac030d2c4dae2664b08ee0bce9c4c915 (patch)
tree648f26e5bc4a97302ac61c7278dd9a6273fb6e3d /tests/migrations
parentcff1f888e997522666835f96833840f52a13d322 (diff)
downloaddjango-1a7b6909ac030d2c4dae2664b08ee0bce9c4c915.tar.gz
Fixed #34052 -- Made migrate --check don't emit signals and output when up to date.
Diffstat (limited to 'tests/migrations')
-rw-r--r--tests/migrations/test_commands.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/migrations/test_commands.py b/tests/migrations/test_commands.py
index 61a914f8ce..9900c7a35d 100644
--- a/tests/migrations/test_commands.py
+++ b/tests/migrations/test_commands.py
@@ -356,6 +356,26 @@ class MigrateTests(MigrationTestBase):
self.assertTableNotExists("migrations_book")
@override_settings(
+ INSTALLED_APPS=[
+ "migrations.migrations_test_apps.migrated_app",
+ ]
+ )
+ def test_migrate_check_migrated_app(self):
+ out = io.StringIO()
+ try:
+ call_command("migrate", "migrated_app", verbosity=0)
+ call_command(
+ "migrate",
+ "migrated_app",
+ stdout=out,
+ check_unapplied=True,
+ )
+ self.assertEqual(out.getvalue(), "")
+ finally:
+ # Unmigrate everything.
+ call_command("migrate", "migrated_app", "zero", verbosity=0)
+
+ @override_settings(
MIGRATION_MODULES={
"migrations": "migrations.test_migrations_plan",
}