#NEWLINE# def test_queryset_or( self ) : #NEWLINE# #INDENT# tournament_1 = Tournament . objects . get ( pk = 1 ) #NEWLINE# tournament_2 = Tournament . objects . get ( pk = 2 ) #NEWLINE# with self . assertNumQueries ( 1 ) : #NEWLINE# #INDENT# pools = ( tournament_1 . pool_set . all ( ) | tournament_2 . pool_set . all ( ) ) #NEWLINE# related_objects = set ( ( pool . tournament for pool in pools ) ) #NEWLINE# self . assertEqual ( related_objects , set ( ( tournament_1 , tournament_2 ) ) )