'Test resolution of __typeof queries, for field in lookup table,
with multiple values'

def testTypeOfLookupTableMultiple(self):

    db = current.db
    uids = self.uids
    resource = current.s3db.resource('typeof_hierarchy_reference')
    expr = FS('typeof_hierarchy_id$name').typeof(('Type    1-2', 'Type    2-1'))
    query = expr.query(resource)
    table = db.typeof_hierarchy
    expected = set((uids[uid] for uid in ('HIERARCHY1-2', 'HIERARCHY1-2-1', 'HIERARCHY1-2-2', 'HIERARCHY2-1', 'HIERARCHY2-1-1', 'HIERARCHY2-1-2')))
    expected_query = table.id.belongs(expected)
    self.assertEquivalent(query, expected_query)
