1
0
mirror of https://github.com/django/django.git synced 2024-11-18 15:34:16 +00:00

Revert "Fixed #23650 -- Prevented migrate from calling checks 3 times"

This reverts commit 8d6e1afe0b.
call_command now always set skip_checks to True (tested in
user_commands).
This commit is contained in:
Claude Paroz 2014-10-19 21:19:30 +02:00
parent 685edab9da
commit 6d11bb102d
2 changed files with 0 additions and 22 deletions

View File

@ -165,7 +165,6 @@ class Command(BaseCommand):
database=db, database=db,
reset_sequences=False, reset_sequences=False,
inhibit_post_migrate=True, inhibit_post_migrate=True,
skip_checks=True,
) )
# Migrate! # Migrate!

View File

@ -139,27 +139,6 @@ class MigrateTests(MigrationTestBase):
stdout = six.StringIO() stdout = six.StringIO()
call_command("migrate", "migrated_unapplied_app", stdout=stdout) call_command("migrate", "migrated_unapplied_app", stdout=stdout)
@override_system_checks([])
@override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations"})
def test_migrate_system_checks(self):
"""
Migrate should only call system checks once, even with test_flush=True (Refs #23650).
"""
from django.core.management.base import BaseCommand
self.counter = 0
def patched_check(self_, **kwargs):
self.counter = self.counter + 1
saved_check = BaseCommand.check
BaseCommand.check = patched_check
try:
call_command("migrate", "migrations", verbosity=0, test_flush=True)
finally:
BaseCommand.check = saved_check
self.assertEqual(self.counter, 1)
class MakeMigrationsTests(MigrationTestBase): class MakeMigrationsTests(MigrationTestBase):
""" """