'test every data type'

def test_datatypes(self):

    conn = self.connections[0]
    c = conn.cursor()
    c.execute('create    table    test_datatypes    (b    bit,    i    int,    l    bigint,    f    real,    s    varchar(32),    u    varchar(32),    bb    blob,    d    date,    dt    datetime,    ts    timestamp,    td    time,    t    time,    st    datetime)')
    try:
        v = (True, (-3), 123456789012, 5.7, 'hello\'"    world', u'Espa\xc3\xb1ol', 'binary\x00data'.encode(conn.charset), datetime.date(1988, 2, 2), datetime.datetime(2014, 5, 15, 7, 45, 57), datetime.timedelta(5, 6), datetime.time(16, 32), time.localtime())
        c.execute('insert    into    test_datatypes    (b,i,l,f,s,u,bb,d,dt,td,t,st)    values    (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)', v)
        c.execute('select    b,i,l,f,s,u,bb,d,dt,td,t,st    from    test_datatypes')
        r = c.fetchone()
        self.assertEqual(util.int2byte(1), r[0])
        self.assertEqual(v[1:10], r[1:10])
        self.assertEqual(datetime.timedelta(0, (60 * ((v[10].hour * 60) + v[10].minute))), r[10])
        self.assertEqual(datetime.datetime(*v[(-1)][:6]), r[(-1)])
        c.execute('delete    from    test_datatypes')
        c.execute('insert    into    test_datatypes    (b,i,l,f,s,u,bb,d,dt,td,t,st)    values    (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)', ([None] * 12))
        c.execute('select    b,i,l,f,s,u,bb,d,dt,td,t,st    from    test_datatypes')
        r = c.fetchone()
        self.assertEqual(tuple(([None] * 12)), r)
        c.execute('delete    from    test_datatypes')
        for seq_type in (tuple, list, set, frozenset):
            c.execute('insert    into    test_datatypes    (i,    l)    values    (2,4),    (6,8),    (10,12)')
            seq = seq_type([2, 6])
            c.execute('select    l    from    test_datatypes    where    i    in    %s    order    by    i', (seq,))
            r = c.fetchall()
            self.assertEqual(((4,), (8,)), r)
            c.execute('delete    from    test_datatypes')
    finally:
        c.execute('drop    table    test_datatypes')
