'Test resolution of field selectors for filtered components'

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

    assertEqual = self.assertEqual
    s3db = current.s3db
    s3db.add_components('org_organisation', org_office={'name': 'test', 'joinby': 'organisation_id', 'filterby': {'office_type_id': 5}})
    resource = s3db.resource('org_organisation')
    rfield = S3ResourceField(resource, 'test.name')
    assertEqual(rfield.tname, 'org_test_office')
    assertEqual(rfield.colname, 'org_test_office.name')
    del current.model.components['org_organisation']['test']
