#NEWLINE# @ test . create_stubs ( { #NEWLINE# #INDENT# api . keystone : ( 'get_default_role' , 'user_list' , 'group_list' , 'role_list' , 'domain_get' ) , #NEWLINE# api . neutron : ( 'is_extension_supported' , 'tenant_quota_get' ) , #NEWLINE# quotas : ( 'get_default_quota_data' , ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# @ override_settings ( OPENSTACK_NEUTRON_NETWORK = { #NEWLINE# #INDENT# 'enable_quotas' : True , #NEWLINE# #UNINDENT# } ) #NEWLINE# def test_add_project_get_with_neutron( self ) : #NEWLINE# #INDENT# quota = self . quotas . first ( ) #NEWLINE# neutron_quotas = self . neutron_quotas . first ( ) #NEWLINE# quotas . get_default_quota_data ( IsA ( http . HttpRequest ) ) . AndReturn ( quota ) #NEWLINE# api . neutron . is_extension_supported ( IsA ( http . HttpRequest ) , 'quotas' ) . MultipleTimes ( ) . AndReturn ( True ) #NEWLINE# api . neutron . is_extension_supported ( IsA ( http . HttpRequest ) , 'security-group' ) . AndReturn ( True ) #NEWLINE# api . neutron . tenant_quota_get ( IsA ( http . HttpRequest ) , tenant_id = self . tenant . id ) . AndReturn ( neutron_quotas ) #NEWLINE# api . keystone . get_default_role ( IsA ( http . HttpRequest ) ) . MultipleTimes ( ) . AndReturn ( self . roles . first ( ) ) #NEWLINE# api . keystone . user_list ( IsA ( http . HttpRequest ) , domain = None ) . AndReturn ( self . users . list ( ) ) #NEWLINE# api . keystone . role_list ( IsA ( http . HttpRequest ) ) . AndReturn ( self . roles . list ( ) ) #NEWLINE# api . keystone . group_list ( IsA ( http . HttpRequest ) , domain = None ) . AndReturn ( self . groups . list ( ) ) #NEWLINE# api . keystone . role_list ( IsA ( http . HttpRequest ) ) . AndReturn ( self . roles . list ( ) ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# res = self . client . get ( reverse ( 'horizon:admin:projects:create' ) ) #NEWLINE# self . assertTemplateUsed ( res , views . WorkflowView . template_name ) #NEWLINE# self . assertContains ( workflow , '<input name="subnet" id="id_subnet" value="10" type="text" />' , html = True ) #NEWLINE# workflow = res . context [ 'workflow' ] #NEWLINE# self . assertEqual ( res . context [ 'workflow' ] . name , workflows . CreateProject . name ) #NEWLINE# step = workflow . get_step ( 'createprojectinfoaction' ) #NEWLINE# self . assertEqual ( step . action . initial [ 'ram' ] , quota . get ( 'ram' ) . limit ) #NEWLINE# self . assertEqual ( step . action . initial [ 'subnet' ] , neutron_quotas . get ( 'subnet' ) . limit )