(self)
| 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 [ |
| 1284 | ([("foo", "0001_bar")], " run_before = [('foo', '0001_bar')]\n"), |
| 1285 | ( |
| 1286 | [("foo", "0001_bar"), ("foo", "0002_baz")], |
| 1287 | " run_before = [('foo', '0001_bar'), ('foo', '0002_baz')]\n", |
| 1288 | ), |
| 1289 | ]: |
| 1290 | with self.subTest(run_before=run_before): |
| 1291 | migration = type( |
| 1292 | "Migration", |
| 1293 | (migrations.Migration,), |
| 1294 | {"operations": [], "run_before": run_before}, |
| 1295 | ) |
| 1296 | writer = MigrationWriter(migration) |
| 1297 | output = writer.as_string() |
| 1298 | self.assertIn(expected_run_before_str, output) |
| 1299 | |
| 1300 | def test_atomic_is_false(self): |
| 1301 | migration = type( |
nothing calls this directly
no test coverage detected