'Altering an FK to a non-FK works (#23244)'

def test_alter_fk_non_fk(self):

    operation = migrations.AlterField(model_name='Rider', name='pony', field=models.FloatField())
    (project_state, new_state) = self.make_test_state('test_afknfk', operation, related_model=True)
    self.assertColumnExists('test_afknfk_rider', 'pony_id')
    self.assertColumnNotExists('test_afknfk_rider', 'pony')
    with connection.schema_editor() as editor:
        operation.database_forwards('test_afknfk', editor, project_state, new_state)
    self.assertColumnExists('test_afknfk_rider', 'pony')
    self.assertColumnNotExists('test_afknfk_rider', 'pony_id')
    with connection.schema_editor() as editor:
        operation.database_backwards('test_afknfk', editor, new_state, project_state)
    self.assertColumnExists('test_afknfk_rider', 'pony_id')
    self.assertColumnNotExists('test_afknfk_rider', 'pony')
