'Field selector resolution without components'

@unittest.skipIf((not current.deployment_settings.has_module('project')), 'project    module    disabled')
def testResolveSelectorsWithoutComponents(self):

    s3db = current.s3db
    assertEqual = self.assertEqual
    assertTrue = self.assertTrue
    resource = s3db.resource('project_project')
    selectors = ['id', 'name', 'organisation_id$name', 'task.description']
    (fields, joins, left, distinct) = resource.resolve_selectors(selectors, skip_components=True)
    project_project = resource.table
    org_organisation = s3db.org_organisation
    expected = org_organisation.on((project_project.organisation_id == org_organisation.id))
    assertEqual(len(fields), 3)
    assertEqual(fields[0].colname, 'project_project.id')
    assertEqual(fields[1].colname, 'project_project.name')
    assertEqual(fields[2].colname, 'org_organisation.name')
    assertEqual(joins, {})
    assertTrue(isinstance(left, dict))
    assertEqual(left.keys(), ['org_organisation'])
    assertEqual(len(left['org_organisation']), 1)
    assertEqual(str(left['org_organisation'][0]), str(expected))
    assertTrue(distinct)
