#NEWLINE# @ test . create_stubs ( { #NEWLINE# #INDENT# api . fwaas : ( 'policy_create' , 'rule_list' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# def test_add_policy_post_with_error( self ) : #NEWLINE# #INDENT# policy = self . fw_policies . first ( ) #NEWLINE# rules = self . fw_rules . list ( ) #NEWLINE# tenant_id = self . tenant . id #NEWLINE# form_data = { #NEWLINE# #INDENT# 'description' : policy . description , #NEWLINE# 'firewall_rules' : None , #NEWLINE# 'shared' : policy . shared , #NEWLINE# 'audited' : policy . audited , #NEWLINE# #UNINDENT# } #NEWLINE# api . fwaas . rule_list ( IsA ( http . HttpRequest ) , tenant_id = tenant_id ) . AndReturn ( rules ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# res = self . client . post ( reverse ( self . ADDPOLICY_PATH ) , form_data ) #NEWLINE# self . assertFormErrors ( res , 1 )