#NEWLINE# def test_many_to_many_related_query_name( self ) : #NEWLINE# #INDENT# a1 = Article . objects . create ( pub_date = datetime . date . today ( ) ) #NEWLINE# i1 = ArticleIdea . objects . create ( name = 'idea1' ) #NEWLINE# a1 . ideas . add ( self ) #NEWLINE# self . assertEqual ( Article . objects . filter ( idea_things__name = 'idea1' ) . count ( ) , 1 ) #NEWLINE# self . assertEqual ( Article . objects . filter ( idea_things__name = 'idea2' ) . count ( ) , 0 ) #NEWLINE# with self . assertRaises ( FieldError ) : #NEWLINE# #INDENT# Article . objects . filter ( ideas__name = 'idea1' )