'Test loading IDs with ambiguous query'

def testLoadIds(self):

    s3db = current.s3db
    assertEqual = self.assertEqual
    assertTrue = self.assertTrue
    query = FS('office.name').like('DATestOffice%')
    resource = s3db.resource('org_organisation')
    resource.add_filter(query)
    uid = resource.get_uid()
    assertTrue(isinstance(uid, str))
    assertEqual(uid, 'DATESTORG')
    query = (query & (FS('testfield') == 'TEST'))
    resource = s3db.resource('org_organisation')
    class FakeVirtualFields(object, ):
        def testfield(self):
            return 'TEST'
    resource.table.virtualfields.append(FakeVirtualFields())
    resource.add_filter(query)
    uid = resource.get_uid()
    assertTrue(isinstance(uid, str))
    assertEqual(uid, 'DATESTORG')
