#NEWLINE# def test_created_without_related( self ) : #NEWLINE# #INDENT# self . assertEqual ( self . a3 . reporter , None ) #NEWLINE# a3 = Article . objects . get ( pk = self . a3 . pk ) #NEWLINE# with self . assertRaises ( AttributeError ) : #NEWLINE# #INDENT# getattr ( self . reporter , 'id' ) #NEWLINE# #UNINDENT# self . assertEqual ( a3 . reporter , None ) #NEWLINE# self . assertQuerysetEqual ( Article . objects . filter ( reporter__isnull = True ) , [ '<Article: Third>' ] ) #NEWLINE# self . assertQuerysetEqual ( Article . objects . filter ( reporter = None ) , [ '<Article: Third>' ] ) #NEWLINE# self . assertQuerysetEqual ( self . r . article_set . all ( ) , [ '<Article: First>' , '<Article: Second>' ] ) #NEWLINE# self . r . article_set . add ( a3 ) #NEWLINE# self . assertQuerysetEqual ( self . r . article_set . all ( ) , [ '<Article: First>' , '<Article: Second>' , '<Article: Third>' ] ) #NEWLINE# self . r . article_set . remove ( a3 ) #NEWLINE# self . assertQuerysetEqual ( self . r . article_set . all ( ) , [ '<Article: First>' , '<Article: Second>' ] ) #NEWLINE# self . assertQuerysetEqual ( Article . objects . filter ( reporter__isnull = True ) , [ '<Article: Third>' ] )