def test_column_aliases():
tc = TableCreator('awesome')
tc.bare('col_bare')
tc.biginteger('col_biginteger')
tc.binary('col_binary')
tc.blob('col_blob')
tc.bool('col_bool')
tc.char('col_char')
tc.date('col_date')
tc.datetime('col_datetime')
tc.decimal('col_decimal')
tc.double('col_double')
tc.fixed('col_fixed')
tc.float('col_float')
tc.int('col_int')
tc.integer('col_integer')
tc.smallint('col_smallint')
tc.smallinteger('col_smallinteger')
tc.text('col_text')
tc.time('col_time')
tc.uuid('col_uuid')
assert isinstance(tc.model.col_bare, peewee.BareField)
assert isinstance(tc.model.col_biginteger, peewee.BigIntegerField)
assert isinstance(tc.model.col_binary, peewee.BlobField)
assert isinstance(tc.model.col_blob, peewee.BlobField)
assert isinstance(tc.model.col_bool, peewee.BooleanField)
assert isinstance(tc.model.col_char, peewee.CharField)
assert isinstance(tc.model.col_date, peewee.DateField)
assert isinstance(tc.model.col_datetime, peewee.DateTimeField)
assert isinstance(tc.model.col_decimal, peewee.DecimalField)
assert isinstance(tc.model.col_double, peewee.DoubleField)
assert isinstance(tc.model.col_fixed, peewee.CharField)
assert isinstance(tc.model.col_float, peewee.FloatField)
assert isinstance(tc.model.col_int, peewee.IntegerField)
assert isinstance(tc.model.col_integer, peewee.IntegerField)
assert isinstance(tc.model.col_smallint, peewee.SmallIntegerField)
assert isinstance(tc.model.col_smallinteger, peewee.SmallIntegerField)
assert isinstance(tc.model.col_text, peewee.TextField)
assert isinstance(tc.model.col_time, peewee.TimeField)
assert isinstance(tc.model.col_uuid, peewee.UUIDField)
评论列表
文章目录