'Test whether values for lazy virtual fields can be extracted'

def testLazyVirtualFieldsExtract(self):

    assertEqual = self.assertEqual
    assertTrue = self.assertTrue
    self.record_id = None
    resource = current.s3db.resource('pr_person')
    rows = resource.select(['name', 'first_name', 'last_name'], limit=1, as_rows=True)
    row = rows[0]
    assertTrue(('name' in row))
    assertTrue(callable(row['name']))
    assertEqual(self.record_id, None)
    name = ('%s    %s' % (row.first_name, row.last_name))
    data = resource.select(['name'], limit=1)
    item = data['rows'][0]
    assertTrue(('pr_person.name' in item))
    assertEqual(self.record_id, row.id)
    assertEqual(item['pr_person.name'], name)
