#NEWLINE# def testRootOrgOnaccept( self ) : #NEWLINE# #INDENT# ' Test the root organisation is set onaccept ' #NEWLINE# db = current . db #NEWLINE# s3db = current . s3db #NEWLINE# otable = s3db . org_organisation #NEWLINE# organisation = Storage ( name = 'RootOrgOnacceptTest' ) #NEWLINE# record_id = otable . insert ( ** organisation ) #NEWLINE# self . assertNotEqual ( record_id , None ) #NEWLINE# organisation [ 'id' ] = record_id #NEWLINE# s3db . update_super ( otable , organisation ) #NEWLINE# s3db . onaccept ( otable , organisation , method = 'create' ) #NEWLINE# row = db ( ( otable . id == record_id ) ) . select ( otable . id , otable . root_organisation , limitby = ( 0 , 1 ) ) . first ( ) #NEWLINE# self . assertNotEqual ( row , None ) #NEWLINE# self . assertEqual ( row . root_organisation , row . id )