#NEWLINE# def test_cant_do_distinct_in_joins( self ) : #NEWLINE# #INDENT# "the DISTINCT feature here works when the m2o is in the innermost\n        mapper, but when we are just joining along relationships outside\n        of that, we can still have dupes, and there's no solution to that.\n\n        " #NEWLINE# Movie = self . classes . Movie #NEWLINE# Credit = self . classes . Credit #NEWLINE# s = create_session ( ) #NEWLINE# q = s . query ( Credit ) . options ( subqueryload ( Credit . movie ) . subqueryload ( Movie . director ) ) #NEWLINE# ctx = q . _compile_context ( ) #NEWLINE# q2 = ctx . attributes [ ( 'subquery' , ( inspect ( Credit ) , Credit . movie . property ) ) ] #NEWLINE# ctx2 = q2 . _compile_context ( ) #NEWLINE# q3 = ctx2 . attributes [ ( 'subquery' , ( inspect ( Movie ) , Movie . director . property ) ) ] #NEWLINE# result = s . execute ( q3 ) #NEWLINE# eq_ ( result . fetchall ( ) , [ ( 1 , 'Woody Allen' , 1 ) , ( 1 , 'Woody Allen' , 1 ) ] )