#NEWLINE# @ test . create_stubs ( { #NEWLINE# #INDENT# api . fwaas : ( 'firewall_create' , 'policy_list' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# def test_add_firewall_post_with_error( self ) : #NEWLINE# #INDENT# firewall = self . firewalls . first ( ) #NEWLINE# policies = self . fw_policies . list ( ) #NEWLINE# tenant_id = self . tenant . id #NEWLINE# form_data = { #NEWLINE# #INDENT# 'name' : firewall . name , #NEWLINE# 'description' : firewall . description , #NEWLINE# 'firewall_policy_id' : None , #NEWLINE# 'shared' : firewall . shared , #NEWLINE# 'admin_state_up' : firewall . admin_state_up , #NEWLINE# #UNINDENT# } #NEWLINE# api . fwaas . policy_list ( IsA ( http . HttpRequest ) , tenant_id = tenant_id ) . AndReturn ( policies ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# res = self . client . post ( reverse ( self . ADDFIREWALL_PATH ) , form_data ) #NEWLINE# self . assertFormErrors ( res , 1 )