The loader can load migrations with a dependency on an unmigrated app.
(self)
| 141 | MIGRATION_MODULES={"migrations": "migrations.test_migrations_unmigdep"} |
| 142 | ) |
| 143 | def test_load_unmigrated_dependency(self): |
| 144 | """ |
| 145 | The loader can load migrations with a dependency on an unmigrated app. |
| 146 | """ |
| 147 | # Load and test the plan |
| 148 | migration_loader = MigrationLoader(connection) |
| 149 | self.assertEqual( |
| 150 | migration_loader.graph.forwards_plan(("migrations", "0001_initial")), |
| 151 | [ |
| 152 | ("contenttypes", "0001_initial"), |
| 153 | ("auth", "0001_initial"), |
| 154 | ("migrations", "0001_initial"), |
| 155 | ], |
| 156 | ) |
| 157 | # Now render it out! |
| 158 | project_state = migration_loader.project_state(("migrations", "0001_initial")) |
| 159 | self.assertEqual( |
| 160 | len([m for a, m in project_state.models if a == "migrations"]), 1 |
| 161 | ) |
| 162 | |
| 163 | book_state = project_state.models["migrations", "book"] |
| 164 | self.assertEqual(list(book_state.fields), ["id", "user"]) |
| 165 | |
| 166 | @override_settings( |
| 167 | MIGRATION_MODULES={"migrations": "migrations.test_migrations_run_before"} |
nothing calls this directly
no test coverage detected