'Test the root organisation is set onaccept'

def testRootOrgOnaccept(self):

    db = current.db
    s3db = current.s3db
    otable = s3db.org_organisation
    organisation = Storage(name='RootOrgOnacceptTest')
    record_id = otable.insert(**organisation)
    self.assertNotEqual(record_id, None)
    organisation['id'] = record_id
    s3db.update_super(otable, organisation)
    s3db.onaccept(otable, organisation, method='create')
    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)
