#NEWLINE# @ test . create_stubs ( { #NEWLINE# #INDENT# api . neutron : ( 'port_get' , 'port_modify' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# def test_port_update_post_exception( self ) : #NEWLINE# #INDENT# port = self . ports . first ( ) #NEWLINE# api . neutron . port_get ( IsA ( http . HttpRequest ) , port . id ) . AndReturn ( port ) #NEWLINE# api . neutron . port_modify ( IsA ( http . HttpRequest ) , port . id , name = port . name , admin_state_up = port . admin_state_up , device_id = port . device_id , device_owner = port . device_owner ) . AndRaise ( self . exceptions . neutron ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# form_data = { #NEWLINE# #INDENT# 'network_id' : port . network_id , #NEWLINE# 'port_id' : port . id , #NEWLINE# 'name' : port . name , #NEWLINE# 'admin_state' : port . admin_state_up , #NEWLINE# 'device_id' : port . device_id , #NEWLINE# 'device_owner' : port . device_owner , #NEWLINE# #UNINDENT# } #NEWLINE# url = reverse ( 'horizon:admin:networks:editport' , args = [ port . network_id , port . id ] ) #NEWLINE# res = self . client . post ( url , redir_url ) #NEWLINE# redir_url = reverse ( 'horizon:admin:networks:detail' , args = [ port . network_id ] ) #NEWLINE# self . assertRedirectsNoFollow ( res , redir_url )