django.db.models shouldn't be imported if unused.
(self)
| 1185 | ) |
| 1186 | |
| 1187 | def test_models_import_omitted(self): |
| 1188 | """ |
| 1189 | django.db.models shouldn't be imported if unused. |
| 1190 | """ |
| 1191 | migration = type( |
| 1192 | "Migration", |
| 1193 | (migrations.Migration,), |
| 1194 | { |
| 1195 | "operations": [ |
| 1196 | migrations.AlterModelOptions( |
| 1197 | name="model", |
| 1198 | options={ |
| 1199 | "verbose_name": "model", |
| 1200 | "verbose_name_plural": "models", |
| 1201 | }, |
| 1202 | ), |
| 1203 | ] |
| 1204 | }, |
| 1205 | ) |
| 1206 | writer = MigrationWriter(migration) |
| 1207 | output = writer.as_string() |
| 1208 | self.assertIn("from django.db import migrations\n", output) |
| 1209 | |
| 1210 | def test_deconstruct_class_arguments(self): |
| 1211 | # Yes, it doesn't make sense to use a class as a default for a |
nothing calls this directly
no test coverage detected