#NEWLINE# @ test . create_stubs ( { #NEWLINE# #INDENT# api . neutron : ( 'network_get' , ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# def test_subnet_create_post_invalid_pools_invalid_address( self ) : #NEWLINE# #INDENT# network = self . networks . first ( ) #NEWLINE# subnet = self . subnets . first ( ) #NEWLINE# api . neutron . network_get ( IsA ( http . HttpRequest ) , network . id ) . AndReturn ( network ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# allocation_pools = '10.0.0.2,invalid_address' #NEWLINE# form_data = form_data_subnet ( subnet , allocation_pools = allocation_pools ) #NEWLINE# url = reverse ( 'horizon:project:networks:addsubnet' , args = [ subnet . network_id ] ) #NEWLINE# res = self . client . post ( url , form_data ) #NEWLINE# self . assertContains ( res , ( 'allocation_pools: Invalid IP address (value=%s)' % allocation_pools . split ( ',' ) [ 1 ] ) )