MCPcopy
hub / github.com/django/django / test_sorted_dependencies

Method test_sorted_dependencies

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

Source from the content-addressed store, hash-verified

1099 )
1100
1101 def test_sorted_dependencies(self):
1102 migration = type(
1103 "Migration",
1104 (migrations.Migration,),
1105 {
1106 "operations": [
1107 migrations.AddField("mymodel", "myfield", models.IntegerField()),
1108 ],
1109 "dependencies": [
1110 ("testapp10", "0005_fifth"),
1111 ("testapp02", "0005_third"),
1112 ("testapp02", "0004_sixth"),
1113 ("testapp01", "0001_initial"),
1114 ],
1115 },
1116 )
1117 output = MigrationWriter(migration, include_header=False).as_string()
1118 self.assertIn(
1119 " dependencies = [\n"
1120 " ('testapp01', '0001_initial'),\n"
1121 " ('testapp02', '0004_sixth'),\n"
1122 " ('testapp02', '0005_third'),\n"
1123 " ('testapp10', '0005_fifth'),\n"
1124 " ]",
1125 output,
1126 )
1127
1128 def test_sorted_imports(self):
1129 """

Callers

nothing calls this directly

Calls 2

MigrationWriterClass · 0.90
as_stringMethod · 0.45

Tested by

no test coverage detected