'Tests the RemoveField operation.'

def test_remove_field(self):

    project_state = self.set_up_test_model('test_rmfl')
    operation = migrations.RemoveField('Pony', 'pink')
    self.assertEqual(operation.describe(), 'Remove    field    pink    from    Pony')
    new_state = project_state.clone()
    operation.state_forwards('test_rmfl', new_state)
    self.assertEqual(len(new_state.models[('test_rmfl', 'pony')].fields), 2)
    self.assertColumnExists('test_rmfl_pony', 'pink')
    with connection.schema_editor() as editor:
        operation.database_forwards('test_rmfl', editor, project_state, new_state)
    self.assertColumnNotExists('test_rmfl_pony', 'pink')
    with connection.schema_editor() as editor:
        operation.database_backwards('test_rmfl', editor, new_state, project_state)
    self.assertColumnExists('test_rmfl_pony', 'pink')
    definition = operation.deconstruct()
    self.assertEqual(definition[0], 'RemoveField')
    self.assertEqual(definition[1], [])
    self.assertEqual(definition[2], {'model_name': 'Pony', 'name': 'pink'})
