'Test resolution of __typeof queries, for field in lookup table,
with None value'

def testTypeOfLookupTableNone(self):

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