#NEWLINE# def test_reverse_single_related( self ) : #NEWLINE# #INDENT# public_source = Source . objects . create ( is_public = True ) #NEWLINE# public_item = Item . objects . create ( source = public_source ) #NEWLINE# private_source = Source . objects . create ( is_public = False ) #NEWLINE# private_item = Item . objects . create ( source = private_source ) #NEWLINE# self . assertQuerysetEqual ( Source . objects . all ( ) , [ '<Source: Source object>' ] ) #NEWLINE# self . assertEqual ( public_item . source , public_source ) #NEWLINE# self . assertEqual ( private_item . source , private_source ) #NEWLINE# Source . objects . use_for_related_fields = True #NEWLINE# private_item = Item . objects . get ( pk = private_item . pk ) #NEWLINE# self . assertRaises ( Source . DoesNotExist , ( lambda : private_item . source ) )