Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Romain Courteaud
slapos.core
Commits
3d68dd50
Commit
3d68dd50
authored
Jan 09, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: person can not request project anymore
parent
07849d75
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
101 deletions
+0
-101
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudPersonSlapInterfaceWorkflow.py
...s/test.erp5.testSlapOSCloudPersonSlapInterfaceWorkflow.py
+0
-101
No files found.
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudPersonSlapInterfaceWorkflow.py
View file @
3d68dd50
...
...
@@ -818,107 +818,6 @@ class TestSlapOSCorePersonRequestComputeNode(SlapOSTestCaseMixin):
compute_node_title
=
compute_node_title
)
class
TestSlapOSCorePersonRequestProject
(
SlapOSTestCaseMixin
):
def
generateNewProjectTitle
(
self
):
return
'My Project %s'
%
self
.
generateNewId
()
def
afterSetUp
(
self
):
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
self
.
project
=
self
.
addProject
()
person_user
=
self
.
makePerson
(
self
.
project
)
self
.
tic
()
# Login as new user
self
.
login
(
person_user
.
getUserId
())
new_person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
self
.
assertEqual
(
person_user
.
getRelativeUrl
(),
new_person
.
getRelativeUrl
())
def
beforeTearDown
(
self
):
pass
def
test_Person_requestProject_title_is_mandatoty
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
self
.
assertRaises
(
TypeError
,
person
.
requestProject
)
def
test_Person_requestProject
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
project_title
=
self
.
generateNewProjectTitle
()
person
.
requestProject
(
project_title
=
project_title
)
self
.
tic
()
self
.
login
()
# check what is returned via request
project_relative_url
=
person
.
REQUEST
.
get
(
'project_relative_url'
)
project_reference
=
person
.
REQUEST
.
get
(
'project_reference'
)
self
.
assertNotEqual
(
None
,
project_relative_url
)
self
.
assertNotEqual
(
None
,
project_reference
)
project
=
person
.
restrictedTraverse
(
project_relative_url
)
self
.
assertEqual
(
project
.
getTitle
(),
project_title
)
self
.
assertEqual
(
project
.
getValidationState
(),
"validated"
)
self
.
assertEqual
(
project
.
getDestinationDecision
(),
person
.
getRelativeUrl
())
def
test_Person_requestProject_duplicated
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
project_title
=
self
.
generateNewProjectTitle
()
person
.
requestProject
(
project_title
=
project_title
)
self
.
tic
()
self
.
login
()
# check what is returned via request
project_relative_url
=
person
.
REQUEST
.
get
(
'project_relative_url'
)
project_reference
=
person
.
REQUEST
.
get
(
'project_reference'
)
self
.
assertNotEqual
(
None
,
project_relative_url
)
self
.
assertNotEqual
(
None
,
project_reference
)
project
=
person
.
restrictedTraverse
(
project_relative_url
)
self
.
assertEqual
(
project
.
getTitle
(),
project_title
)
self
.
assertEqual
(
project
.
getValidationState
(),
"validated"
)
self
.
assertEqual
(
project
.
getDestinationDecision
(),
person
.
getRelativeUrl
())
project2
=
project
.
Base_createCloneDocument
(
batch_mode
=
1
)
project2
.
validate
()
self
.
tic
()
self
.
login
(
person
.
getUserId
())
self
.
assertRaises
(
NotImplementedError
,
person
.
requestProject
,
project_title
=
project_title
)
def
test_Person_requestProject_request_again
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
project_title
=
self
.
generateNewProjectTitle
()
person
.
requestProject
(
project_title
=
project_title
)
# check what is returned via request
project_relative_url
=
person
.
REQUEST
.
get
(
'project_relative_url'
)
project_reference
=
person
.
REQUEST
.
get
(
'project_reference'
)
self
.
assertNotEqual
(
None
,
project_relative_url
)
self
.
assertNotEqual
(
None
,
project_reference
)
self
.
tic
()
self
.
login
()
# check what is returned via request
person
.
REQUEST
.
set
(
'project_relative_url'
,
None
)
person
.
REQUEST
.
set
(
'project_reference'
,
None
)
self
.
login
(
person
.
getUserId
())
person
.
requestProject
(
project_title
=
project_title
)
# check what is returned via request
same_project_relative_url
=
person
.
REQUEST
.
get
(
'project_relative_url'
)
same_project_reference
=
person
.
REQUEST
.
get
(
'project_reference'
)
self
.
assertEqual
(
same_project_relative_url
,
project_relative_url
)
self
.
assertEqual
(
same_project_reference
,
project_reference
)
class
TestSlapOSCorePersonRequestSite
(
SlapOSTestCaseMixin
):
def
generateNewOrganisationTitle
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment