(self)
| 529 | |
| 530 | @isolate_apps("schema") |
| 531 | def test_char_field_pk_to_auto_field(self): |
| 532 | class Foo(Model): |
| 533 | id = CharField(max_length=255, primary_key=True) |
| 534 | |
| 535 | class Meta: |
| 536 | app_label = "schema" |
| 537 | |
| 538 | with connection.schema_editor() as editor: |
| 539 | editor.create_model(Foo) |
| 540 | self.isolated_local_models = [Foo] |
| 541 | old_field = Foo._meta.get_field("id") |
| 542 | new_field = AutoField(primary_key=True) |
| 543 | new_field.set_attributes_from_name("id") |
| 544 | new_field.model = Foo |
| 545 | with connection.schema_editor() as editor: |
| 546 | editor.alter_field(Foo, old_field, new_field, strict=True) |
| 547 | |
| 548 | @skipUnlessDBFeature("supports_foreign_keys") |
| 549 | def test_fk_to_proxy(self): |
nothing calls this directly
no test coverage detected