#NEWLINE# def test_m2m_remove( self ) : #NEWLINE# #INDENT# auth = Person . objects . create ( name = 'Someone' ) #NEWLINE# book = Book . objects . create ( title = 'Pro Django' , published = datetime . date ( 2008 , 12 , 16 ) ) #NEWLINE# book . authors . add ( auth ) #NEWLINE# try : #NEWLINE# #INDENT# with self . override_router ( ) : #NEWLINE# #INDENT# book . authors . remove ( auth ) #NEWLINE# #UNINDENT# self . fail ( 'db_for_write() not invoked on router' ) #NEWLINE# #UNINDENT# except RouterUsed as e : #NEWLINE# #INDENT# self . assertEqual ( e . mode , RouterUsed . WRITE ) #NEWLINE# self . assertEqual ( e . model , Book . authors . through ) #NEWLINE# self . assertEqual ( e . hints , { #NEWLINE# #INDENT# 'instance' : book , #NEWLINE# #UNINDENT# } )