MCPcopy
hub / github.com/django/django / test_run_before

Method test_run_before

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

Source from the content-addressed store, hash-verified

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(

Callers

nothing calls this directly

Calls 2

as_stringMethod · 0.95
MigrationWriterClass · 0.90

Tested by

no test coverage detected