#NEWLINE# def test_reverse_fk_update( self ) : #NEWLINE# #INDENT# owner = Person . objects . create ( name = 'Someone' ) #NEWLINE# Pet . objects . create ( name = 'fido' , owner = owner ) #NEWLINE# try : #NEWLINE# #INDENT# with self . override_router ( ) : #NEWLINE# #INDENT# owner . pet_set . update ( name = 'max' ) #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 , Pet ) #NEWLINE# self . assertEqual ( e . hints , { #NEWLINE# #INDENT# 'instance' : self , #NEWLINE# #UNINDENT# } )