'Returns a pattern.db.Query object on a mock Table and Database.'

def _query(self, *args, **kwargs):

    class Database:
        (escape, relations) = ((lambda self, v: db._escape(v)), [])
    class Table:
        (name, fields, db) = ('persons', ['id', 'name', 'age', 'sex'], Database())
    return db.Query(Table(), *args, **kwargs)
