MCPcopy
hub / github.com/django/django / test_migration_path

Method test_migration_path

tests/migrations/test_writer.py:1037–1053  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1035 self.assertIn("Migration", result)
1036
1037 def test_migration_path(self):
1038 test_apps = [
1039 "migrations.migrations_test_apps.normal",
1040 "migrations.migrations_test_apps.with_package_model",
1041 "migrations.migrations_test_apps.without_init_file",
1042 ]
1043
1044 base_dir = os.path.dirname(os.path.dirname(__file__))
1045
1046 for app in test_apps:
1047 with self.modify_settings(INSTALLED_APPS={"append": app}):
1048 migration = migrations.Migration("0001_initial", app.split(".")[-1])
1049 expected_path = os.path.join(
1050 base_dir, *(app.split(".") + ["migrations", "0001_initial.py"])
1051 )
1052 writer = MigrationWriter(migration)
1053 self.assertEqual(writer.path, expected_path)
1054
1055 @override_settings(
1056 MIGRATION_MODULES={"namespace_app": "namespace_app.migrations"},

Callers

nothing calls this directly

Calls 5

MigrationWriterClass · 0.90
modify_settingsMethod · 0.80
MigrationMethod · 0.80
splitMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected