MCPcopy
hub / github.com/django/django / test_check_consistent_history

Method test_check_consistent_history

tests/migrations/test_loader.py:479–489  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

477 INSTALLED_APPS=["migrations"],
478 )
479 def test_check_consistent_history(self):
480 loader = MigrationLoader(connection=None)
481 loader.check_consistent_history(connection)
482 recorder = MigrationRecorder(connection)
483 self.record_applied(recorder, "migrations", "0002_second")
484 msg = (
485 "Migration migrations.0002_second is applied before its dependency "
486 "migrations.0001_initial on database 'default'."
487 )
488 with self.assertRaisesMessage(InconsistentMigrationHistory, msg):
489 loader.check_consistent_history(connection)
490
491 @override_settings(
492 MIGRATION_MODULES={"migrations": "migrations.test_migrations_squashed_extra"},

Callers

nothing calls this directly

Calls 5

record_appliedMethod · 0.95
MigrationLoaderClass · 0.90
MigrationRecorderClass · 0.90
assertRaisesMessageMethod · 0.80

Tested by

no test coverage detected