#NEWLINE# def test_query_second_model_by_intermediate_model_attribute( self ) : #NEWLINE# #INDENT# Membership . objects . create ( person = self . jane , group = self . roll , invite_reason = 'She was just awesome.' ) #NEWLINE# Membership . objects . create ( person = self . jim , group = self . roll , invite_reason = 'He is good.' ) #NEWLINE# Membership . objects . create ( person = self . bob , group = self . roll ) #NEWLINE# qs = Person . objects . filter ( membership__invite_reason = 'She was just awesome.' ) #NEWLINE# self . assertQuerysetEqual ( qs , [ 'Jane' ] , attrgetter ( 'name' ) )