'Test adding columns'

def test_add_columns(self):

    db.create_table('test_addc', [('spam', models.BooleanField(default=False)), ('eggs', models.IntegerField())])
    db.add_column('test_addc', 'add1', models.IntegerField(default=3))
    User = db.mock_model(model_name='User', db_table='auth_user', db_tablespace='', pk_field_name='id', pk_field_type=models.AutoField, pk_field_args=[], pk_field_kwargs={})
    db.execute('INSERT    INTO    test_addc    (spam,    eggs,    add1)    VALUES    (%s,    1,    2)', [False])
    db.add_column('test_addc', 'user', models.ForeignKey(User, null=True))
    db.execute_deferred_sql()
    val = db.execute('SELECT    user_id    FROM    test_addc')[0][0]
    self.assertEquals(val, None)
    db.delete_column('test_addc', 'add1')
    db.add_column('test_addc', 'add2', models.CharField(max_length=15, db_index=True, default='pi'))
    db.execute_deferred_sql()
    db.delete_table('test_addc')
