#NEWLINE# @ test . create_stubs ( { #NEWLINE# #INDENT# api . fwaas : ( 'rule_create' , ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# def test_add_rule_post( self ) : #NEWLINE# #INDENT# rule1 = self . fw_rules . first ( ) #NEWLINE# form_data = { #NEWLINE# #INDENT# 'name' : rule1 . name , #NEWLINE# 'description' : rule1 . description , #NEWLINE# 'protocol' : rule1 . protocol , #NEWLINE# 'action' : rule1 . action , #NEWLINE# 'source_ip_address' : rule1 . source_ip_address , #NEWLINE# 'source_port' : rule1 . source_port , #NEWLINE# 'destination_ip_address' : rule1 . destination_ip_address , #NEWLINE# 'destination_port' : rule1 . destination_port , #NEWLINE# 'shared' : rule1 . shared , #NEWLINE# 'enabled' : rule1 . enabled , #NEWLINE# #UNINDENT# } #NEWLINE# api . fwaas . rule_create ( IsA ( http . HttpRequest ) , ** form_data ) . AndReturn ( rule1 ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# res = self . client . post ( reverse ( self . ADDRULE_PATH ) , form_data ) #NEWLINE# self . assertNoFormErrors ( res ) #NEWLINE# self . assertRedirectsNoFollow ( res , str ( form_data . INDEX_URL ) )