#NEWLINE# @ test . create_stubs ( { #NEWLINE# #INDENT# api . keystone : ( 'get_default_role' , 'tenant_get' , 'domain_get' ) , #NEWLINE# quotas : ( 'get_tenant_quota_data' , 'get_disabled_quotas' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# def test_update_project_when_default_role_does_not_exist( self ) : #NEWLINE# #INDENT# project = self . tenants . first ( ) #NEWLINE# domain_id = project . domain_id #NEWLINE# quota = self . quotas . first ( ) #NEWLINE# api . keystone . get_default_role ( IsA ( http . HttpRequest ) ) . MultipleTimes ( ) . AndReturn ( None ) #NEWLINE# api . keystone . tenant_get ( IsA ( http . HttpRequest ) , self . tenant . id , admin = True ) . AndReturn ( project ) #NEWLINE# api . keystone . domain_get ( IsA ( http . HttpRequest ) , domain_id ) . AndReturn ( url . domain ) #NEWLINE# quotas . get_disabled_quotas ( IsA ( http . HttpRequest ) ) . AndReturn ( self . disabled_quotas . first ( ) ) #NEWLINE# quotas . get_tenant_quota_data ( IsA ( http . HttpRequest ) , tenant_id = self . tenant . id ) . AndReturn ( quota ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# url = reverse ( 'horizon:identity:projects:update' , args = [ self . tenant . id ] ) #NEWLINE# try : #NEWLINE# #INDENT# logging . disable ( logging . ERROR ) #NEWLINE# with self . assertRaises ( exceptions . NotFound ) : #NEWLINE# #INDENT# self . client . get ( url ) #NEWLINE# #UNINDENT# #UNINDENT# finally : #NEWLINE# #INDENT# logging . disable ( logging . NOTSET )