(self)
| 1261 | MigrationWriter.register_serializer(complex, TestModel1) |
| 1262 | |
| 1263 | def test_composite_pk_import(self): |
| 1264 | migration = type( |
| 1265 | "Migration", |
| 1266 | (migrations.Migration,), |
| 1267 | { |
| 1268 | "operations": [ |
| 1269 | migrations.AddField( |
| 1270 | "foo", |
| 1271 | "bar", |
| 1272 | models.CompositePrimaryKey("foo_id", "bar_id"), |
| 1273 | ), |
| 1274 | ], |
| 1275 | }, |
| 1276 | ) |
| 1277 | writer = MigrationWriter(migration) |
| 1278 | output = writer.as_string() |
| 1279 | self.assertEqual(output.count("import"), 1) |
| 1280 | self.assertIn("from django.db import migrations, models", output) |
| 1281 | |
| 1282 | def test_run_before(self): |
| 1283 | for run_before, expected_run_before_str in [ |
nothing calls this directly
no test coverage detected