'Test column renaming'

def test_rename(self):

    cursor = connection.cursor()
    db.create_table('test_rn', [('spam', models.BooleanField(default=False))])
    cursor.execute('SELECT    spam    FROM    test_rn')
    db.rename_column('test_rn', 'spam', 'eggs')
    cursor.execute('SELECT    eggs    FROM    test_rn')
    db.commit_transaction()
    db.start_transaction()
    try:
        cursor.execute('SELECT    spam    FROM    test_rn')
    except:
        pass
    else:
        self.fail('Just-renamed    column    could    be    selected!')
    db.rollback_transaction()
    db.delete_table('test_rn')
    db.start_transaction()
