'Test that sql default value is correct for non-string field types.
Datetimes are handled in test_datetime_default.'

def test_sql_defaults(self):

    class CustomField(with_metaclass(models.SubfieldBase, models.CharField), ):
        description = 'CustomField'
        def get_default(self):
            if self.has_default():
                if callable(self.default):
                    return self.default()
                return self.default
            return super(CustomField, self).get_default()
        def get_prep_value(self, value):
            if (not value):
                return value
            return ','.join(map(str, value))
        def to_python(self, value):
            if ((not value) or isinstance(value, list)):
                return value
            return list(map(int, value.split(',')))
    false_value = ((db.has_booleans and 'False') or '0')
    defaults = ((models.CharField(default='sukasuka'), "DEFAULT    'sukasuka"), (models.BooleanField(default=False), ('DEFAULT    %s' % false_value)), (models.IntegerField(default=42), 'DEFAULT    42'), (CustomField(default=[2012, 2018, 2021, 2036]), "DEFAULT    '2012,2018,2021,2036"))
    for (field, sql_test_str) in defaults:
        sql = db.column_sql('fish', 'YAAAAAAZ', field)
        if (sql_test_str not in sql):
            self.fail(('default    sql    value    was    not    properly    generated    for    field    %r.\nSql    was    %s' % (field, sql)))
