'Tests that queries with helper functions are generated properly'

def test_mintimeuuid_function(self):

    now = datetime.now()
    where = WhereClause('time', EqualsOperator(), functions.MinTimeUUID(now))
    where.set_context_id(5)
    self.assertEqual(str(where), '"time"    =    MinTimeUUID(%(5)s)')
    ctx = {}
    where.update_context(ctx)
    self.assertEqual(ctx, {'5': columns.DateTime().to_database(now)})
