def testRootOrgOnaccept(self):

        db = current.db
        s3db = current.s3db
        otable = s3db.org_organisation

        # Insert new record
        organisation = Storage(name = "RootOrgOnacceptTest")
        record_id = otable.insert(**organisation)
        self.assertNotEqual(record_id, None)

        # Execute update_super and onaccept
        organisation["id"] = record_id
        s3db.update_super(otable, organisation)
        s3db.onaccept(otable, organisation, method="create")

        # Reload the record
        row = db(otable.id == record_id).select(otable.id,
                                                otable.root_organisation,
                                                limitby=(0, 1)).first()

        self.assertNotEqual(row, None)
        self.assertEqual(row.root_organisation, row.id)

    # -------------------------------------------------------------------------
Test the root organisation is set onaccept
dataset/ETHPy150Open sahana/eden/modules/unit_tests/s3db/org.py/RootOrgUpdateTests.testRootOrgOnaccept