#NEWLINE# @ test . create_stubs ( { #NEWLINE# #INDENT# api . fwaas : ( 'policy_get' , 'policy_update' , 'rules_list' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# def test_update_policy_post( self ) : #NEWLINE# #INDENT# policy = self . fw_policies . first ( ) #NEWLINE# api . fwaas . policy_get ( IsA ( http . HttpRequest ) , policy . id ) . AndReturn ( policy ) #NEWLINE# policy . name = 'new name' #NEWLINE# policy . description = 'new desc' #NEWLINE# policy . shared = True #NEWLINE# policy . audited = False #NEWLINE# data = { #NEWLINE# #INDENT# 'name' : policy . name , #NEWLINE# 'description' : policy . description , #NEWLINE# 'shared' : policy . shared , #NEWLINE# 'audited' : policy . audited , #NEWLINE# #UNINDENT# } #NEWLINE# api . fwaas . policy_update ( IsA ( http . HttpRequest ) , policy . id , ** data ) . AndReturn ( policy ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# res = self . client . post ( reverse ( self . UPDATEPOLICY_PATH , args = ( self . id , ) ) , data ) #NEWLINE# self . assertNoFormErrors ( res ) #NEWLINE# self . assertRedirectsNoFollow ( res , str ( self . INDEX_URL ) )