#NEWLINE# def test_from_subclass( self ) : #NEWLINE# #INDENT# Director = self . classes . Director #NEWLINE# s = create_session ( ) #NEWLINE# ctx = s . query ( Director ) . options ( subqueryload ( '*' ) ) . _compile_context ( ) #NEWLINE# q = ctx . attributes [ ( 'subquery' , ( inspect ( Director ) , inspect ( Director ) . attrs . movies ) ) ] #NEWLINE# self . assert_compile ( s , 'SELECT movie.id AS movie_id, persistent.id AS persistent_id, movie.director_id AS movie_director_id, movie.title AS movie_title, anon_1.director_id AS anon_1_director_id FROM (SELECT director.id AS director_id FROM persistent JOIN director ON persistent.id = director.id) AS anon_1 JOIN (persistent JOIN movie ON persistent.id = movie.id) ON anon_1.director_id = movie.director_id ORDER BY anon_1.director_id' , dialect = 'default' )