Tests loading a squashed migration
(self)
| 290 | MIGRATION_MODULES={"migrations": "migrations.test_migrations_squashed"} |
| 291 | ) |
| 292 | def test_loading_squashed(self): |
| 293 | "Tests loading a squashed migration" |
| 294 | migration_loader = MigrationLoader(connection) |
| 295 | recorder = MigrationRecorder(connection) |
| 296 | self.addCleanup(recorder.flush) |
| 297 | # Loading with nothing applied should just give us the one node |
| 298 | self.assertEqual( |
| 299 | len([x for x in migration_loader.graph.nodes if x[0] == "migrations"]), |
| 300 | 1, |
| 301 | ) |
| 302 | # However, fake-apply one migration and it should now use the old two |
| 303 | self.record_applied(recorder, "migrations", "0001_initial") |
| 304 | migration_loader.build_graph() |
| 305 | self.assertEqual( |
| 306 | len([x for x in migration_loader.graph.nodes if x[0] == "migrations"]), |
| 307 | 2, |
| 308 | ) |
| 309 | |
| 310 | @override_settings( |
| 311 | MIGRATION_MODULES={"migrations": "migrations.test_migrations_squashed_complex"} |
nothing calls this directly
no test coverage detected