(self)
| 1076 | writer.path |
| 1077 | |
| 1078 | def test_custom_operation(self): |
| 1079 | migration = type( |
| 1080 | "Migration", |
| 1081 | (migrations.Migration,), |
| 1082 | { |
| 1083 | "operations": [ |
| 1084 | custom_migration_operations.operations.TestOperation(), |
| 1085 | custom_migration_operations.operations.CreateModel(), |
| 1086 | migrations.CreateModel("MyModel", (), {}, (models.Model,)), |
| 1087 | custom_migration_operations.more_operations.TestOperation(), |
| 1088 | ], |
| 1089 | "dependencies": [], |
| 1090 | }, |
| 1091 | ) |
| 1092 | writer = MigrationWriter(migration) |
| 1093 | output = writer.as_string() |
| 1094 | result = self.safe_exec(output) |
| 1095 | self.assertIn("custom_migration_operations", result) |
| 1096 | self.assertNotEqual( |
| 1097 | result["custom_migration_operations"].operations.TestOperation, |
| 1098 | result["custom_migration_operations"].more_operations.TestOperation, |
| 1099 | ) |
| 1100 | |
| 1101 | def test_sorted_dependencies(self): |
| 1102 | migration = type( |
nothing calls this directly
no test coverage detected