#NEWLINE# @ test . create_stubs ( { #NEWLINE# #INDENT# api . neutron : ( 'network_get' , 'subnet_create' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# def test_subnet_create_post_subnet_exception( self ) : #NEWLINE# #INDENT# network = self . networks . first ( ) #NEWLINE# subnet = self . subnets . first ( ) #NEWLINE# api . neutron . network_get ( IsA ( http . HttpRequest ) , network . id ) . AndReturn ( self . networks . first ( ) ) #NEWLINE# api . neutron . subnet_create ( IsA ( http . HttpRequest ) , network_id = network . id , name = subnet . name , cidr = subnet . cidr , ip_version = subnet . ip_version , gateway_ip = subnet . gateway_ip , enable_dhcp = subnet . enable_dhcp ) . AndRaise ( self . exceptions . neutron ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# form_data = form_data_subnet ( subnet , allocation_pools = [ ] ) #NEWLINE# url = reverse ( 'horizon:project:networks:addsubnet' , args = [ subnet . network_id ] ) #NEWLINE# res = self . client . post ( url , form_data ) #NEWLINE# redir_url = reverse ( 'horizon:project:networks:detail' , args = [ subnet . network_id ] ) #NEWLINE# self . assertRedirectsNoFollow ( res , redir_url )