#NEWLINE# @ test . create_stubs ( { #NEWLINE# #INDENT# api . fwaas : ( 'firewall_get' , 'policies_list' , 'firewall_update' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# def test_update_firewall_post( self ) : #NEWLINE# #INDENT# firewall = self . firewalls . first ( ) #NEWLINE# tenant_id = firewall . tenant_id #NEWLINE# api . fwaas . firewall_get ( IsA ( http . HttpRequest ) , firewall . id ) . AndReturn ( firewall ) #NEWLINE# firewall . name = 'new name' #NEWLINE# firewall . description = 'new desc' #NEWLINE# firewall . admin_state_up = False #NEWLINE# data = { #NEWLINE# #INDENT# 'name' : firewall . name , #NEWLINE# 'description' : firewall . description , #NEWLINE# 'firewall_policy_id' : firewall . firewall_policy_id , #NEWLINE# 'admin_state_up' : firewall . admin_state_up , #NEWLINE# #UNINDENT# } #NEWLINE# policies = self . fw_policies . list ( ) #NEWLINE# api . fwaas . policies_list ( IsA ( http . HttpRequest ) , tenant_id = tenant_id ) . AndReturn ( policies ) #NEWLINE# api . fwaas . firewall_update ( IsA ( http . HttpRequest ) , firewall . id , ** data ) . AndReturn ( data ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# res = self . client . post ( reverse ( self . UPDATEFIREWALL_PATH , args = ( firewall . id , ) ) , data ) #NEWLINE# self . assertNoFormErrors ( res ) #NEWLINE# self . assertRedirectsNoFollow ( res , str ( self . INDEX_URL ) )