(self)
| 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 | """ |
nothing calls this directly
no test coverage detected