def testLazyVirtualFieldsExtract(self):

        assertEqual = self.assertEqual
        assertTrue = self.assertTrue

        self.record_id = None

        resource = current.s3db.resource("pr_person")

        # Select raw rows
        rows = resource.select(["name", "first_name", "last_name"],
                               limit=1, as_rows=True)
        row = rows[0]
        assertTrue("name" in row)
        assertTrue(callable(row["name"]))
        # lazy field not called
        assertEqual(self.record_id, None)

        name = "%s %s" % (row.first_name, row.last_name)

        # Select with value extraction
        data = resource.select(["name"], limit=1)
        item = data["rows"][0]
        assertTrue("pr_person.name" in item)
        # lazy field called
        assertEqual(self.record_id, row.id)

        assertEqual(item["pr_person.name"], name)

    # -------------------------------------------------------------------------
Test whether values for lazy virtual fields can be extracted
dataset/ETHPy150Open sahana/eden/modules/unit_tests/s3/s3resource.py/ResourceLazyVirtualFieldsSupportTests.testLazyVirtualFieldsExtract