#NEWLINE# def test_cannot_use_setattr_on_m2m_with_intermediary_model( self ) : #NEWLINE# #INDENT# msg = 'Cannot set values on a ManyToManyField which specifies an intermediary model' #NEWLINE# members = list ( Person . objects . filter ( name__in = [ 'Bob' , 'Jim' ] ) ) #NEWLINE# with self . assertRaisesMessage ( AttributeError , msg ) : #NEWLINE# #INDENT# self . rock . members . set ( members ) #NEWLINE# #UNINDENT# self . assertQuerysetEqual ( self . rock . members . all ( ) , [ ] )