#NEWLINE# def test_nullable_GFK( self ) : #NEWLINE# #INDENT# TaggedItem . objects . create ( tag = 'awesome' , content_object = self . book1 , created_by = self . reader1 ) #NEWLINE# TaggedItem . objects . create ( tag = 'great' , content_object = self . book2 ) #NEWLINE# TaggedItem . objects . create ( tag = 'rubbish' , content_object = self . book3 ) #NEWLINE# with self . assertNumQueries ( 2 ) : #NEWLINE# #INDENT# result = [ t . created_by for t in TaggedItem . objects . prefetch_related ( 'created_by' ) ] #NEWLINE# #UNINDENT# self . assertEqual ( result , [ t . created_by for t in TaggedItem . objects . all ( ) ] )