'Test altering column defaults with char fields'

def test_alter_char_default(self):

    db.create_table('test_altercd', [('spam', models.CharField(max_length=30)), ('eggs', models.IntegerField())])
    db.alter_column('test_altercd', 'spam', models.CharField(max_length=30, default='loof', null=True))
    db.execute('INSERT    INTO    test_altercd    (eggs)    values    (12)')
    null = db.execute('SELECT    spam    FROM    test_altercd')[0][0]
    self.assertFalse(null, 'Default    for    char    field    was    installed    into    database')
    db.alter_column('test_altercd', 'spam', models.CharField(max_length=30, default='loof', null=False))
    if ('oracle' in db.backend_name):
        db.execute('DELETE    FROM    test_altercd')
        db.execute('INSERT    INTO    test_altercd    (eggs)    values    (12)')
        null = db.execute('SELECT    spam    FROM    test_altercd')[0][0]
        self.assertFalse(null, 'Default    for    char    field    was    installed    into    database')
    else:
        self.assertRaises(IntegrityError, db.execute, 'INSERT    INTO    test_altercd    (eggs)    values    (12)')
