#NEWLINE# @ test . create_stubs ( { #NEWLINE# #INDENT# api . neutron : ( 'network_get' , 'is_extension_supported' , 'subnetpool_list' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# def test_subnet_create_post_gw_inconsistent( self , test_with_subnetpool = False ) : #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 . is_extension_supported ( IsA ( http . HttpRequest ) , 'subnet_allocation' ) . AndReturn ( True ) #NEWLINE# api . neutron . subnetpool_list ( IsA ( http . HttpRequest ) ) . AndReturn ( self . subnetpools . list ( ) ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# form_data = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if test_with_subnetpool : #NEWLINE# #INDENT# subnetpool = self . subnetpools . first ( ) #NEWLINE# form_data [ 'subnetpool' ] = subnetpool . id #NEWLINE# #UNINDENT# gateway_ip = '2001:0DB8:0:CD30:123:4567:89AB:CDEF' #NEWLINE# form_data . update ( form_data_subnet ( subnet , gateway_ip = gateway_ip , 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 , 'Gateway IP and IP version are inconsistent.' )