#NEWLINE# def test_multi_join( self ) : #NEWLINE# #INDENT# sess = create_session ( ) #NEWLINE# e = aliased ( Person ) #NEWLINE# c = aliased ( Company ) #NEWLINE# q = sess . query ( Company , Person , c , e ) . join ( Person , Company . employees ) . join ( e , c . employees ) . filter ( ( Person . name == 'dilbert' ) ) . filter ( ( c . name == 'wally' ) ) #NEWLINE# eq_ ( q . count ( ) , 1 ) #NEWLINE# eq_ ( q . all ( ) , [ ( Company ( company_id = 1 , name = 'MegaCorp, Inc.' ) , Engineer ( status = 'regular engineer' , engineer_name = 'dilbert' , name = 'dilbert' , company_id = 1 , primary_language = 'java' , person_id = 1 , type = 'engineer' ) , Company ( company_id = 1 , name = 'MegaCorp, Inc.' ) , Engineer ( status = 'regular engineer' , engineer_name = 'wally' , name = 'wally' , company_id = 1 , primary_language = 'c++' , person_id = 2 , type = 'engineer' ) ) ] )