#NEWLINE# def test_foreign_key_prefetch_related( self ) : #NEWLINE# #INDENT# with self . assertNumQueries ( 2 ) : #NEWLINE# #INDENT# tournament = Tournament . objects . prefetch_related ( 'pool_set' ) . get ( pk = 1 ) #NEWLINE# pool = tournament . pool_set . all ( ) [ 0 ] #NEWLINE# self . assertIs ( pool , pool . tournament )