#NEWLINE# def test_save_invalid_m2m_should_have_form_errors( self ) : #NEWLINE# #INDENT# form = self . SampleForm ( { #NEWLINE# #INDENT# 'lead_article' : self . article_1 . id , #NEWLINE# 'articles' : [ self . long_article_2 . id ] , #NEWLINE# #UNINDENT# } , _user = self . user2 ) #NEWLINE# self . assertFalse ( form . is_valid ( ) ) #NEWLINE# self . assertEqual ( form . errors , { #NEWLINE# #INDENT# 'articles' : [ "You don't have permissions to select this value" ] , #NEWLINE# #UNINDENT# } )