'test aggregate functions'

def test_aggregates(self):

    conn = self.connections[0]
    c = conn.cursor()
    try:
        c.execute('create    table    test_aggregates    (i    integer)')
        for i in range(0, 10):
            c.execute('insert    into    test_aggregates    (i)    values    (%s)', (i,))
        c.execute('select    sum(i)    from    test_aggregates')
        (r,) = c.fetchone()
        self.assertEqual(sum(range(0, 10)), r)
    finally:
        c.execute('drop    table    test_aggregates')
