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

Refs #26421 -- Refactored Apps.lazy_model_operation() for better checks and tests

This commit is contained in:
Alex Hill
2016-05-18 23:18:40 +08:00
committed by Tim Graham
parent 0eac5535f7
commit 2ff7ef15b0
9 changed files with 239 additions and 96 deletions

View File

@@ -449,6 +449,12 @@ class MigrateTests(MigrationTestBase):
"""
call_command("migrate", "migrated_unapplied_app", stdout=six.StringIO())
# unmigrated_app.SillyModel has a foreign key to 'migrations.Tribble',
# but that model is only defined in a migration, so the global app
# registry never sees it and the reference is left dangling. Remove it
# to avoid problems in subsequent tests.
del apps._pending_operations[('migrations', 'tribble')]
@override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations_squashed"})
def test_migrate_record_replaced(self):
"""