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
2e1529e4
Commit
2e1529e4
authored
Jan 06, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: no requestTransfer anymore
parent
c27a7ac5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
198 deletions
+0
-198
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudInstanceSlapInterfaceWorkflow.py
...test.erp5.testSlapOSCloudInstanceSlapInterfaceWorkflow.py
+0
-198
No files found.
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudInstanceSlapInterfaceWorkflow.py
View file @
2e1529e4
...
...
@@ -21,8 +21,6 @@
from
erp5.component.test.SlapOSTestCaseMixin
import
SlapOSTestCaseMixin
import
transaction
from
unittest
import
expectedFailure
from
time
import
sleep
from
zExceptions
import
Unauthorized
class
TestSlapOSCoreInstanceSlapInterfaceWorkflow
(
SlapOSTestCaseMixin
):
"""Tests instance.requestInstance"""
...
...
@@ -950,202 +948,6 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin):
self
.
tic
()
return
organisation
def
test_RequesterInstance_requestTransfer_Unauthorized
(
self
):
destination_section
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
self
.
login
()
self
.
assertRaises
(
Unauthorized
,
self
.
instance_tree
.
requestTransfer
,
destination
=
None
,
destination_project
=
None
)
self
.
login
(
destination_section
.
getUserId
())
self
.
assertRaises
(
Unauthorized
,
self
.
instance_tree
.
requestTransfer
,
destination
=
None
,
destination_project
=
None
)
self
.
login
()
other_user
=
self
.
makePerson
(
self
.
project
,
user
=
1
)
self
.
assertEqual
(
1
,
len
(
other_user
.
objectValues
(
portal_type
=
"ERP5 Login"
)))
self
.
instance_tree
.
setDestinationSectionValue
(
destination_section
)
self
.
tic
()
self
.
assertRaises
(
Unauthorized
,
self
.
instance_tree
.
requestTransfer
,
destination
=
None
,
destination_project
=
None
)
self
.
login
(
other_user
.
getUserId
())
self
.
assertRaises
(
Unauthorized
,
self
.
instance_tree
.
requestTransfer
,
destination
=
None
,
destination_project
=
None
)
self
.
login
(
destination_section
.
getUserId
())
self
.
assertEqual
(
self
.
instance_tree
.
requestTransfer
(
destination
=
None
,
destination_project
=
None
),
None
)
def
test_RequesterInstance_requestTransfer_project
(
self
):
destination_section
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
self
.
instance_tree
.
setDestinationSectionValue
(
destination_section
)
self
.
login
()
project
=
self
.
_makeProject
()
other_project
=
self
.
_makeProject
()
self
.
tic
()
self
.
login
(
destination_section
.
getUserId
())
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentProjectValue
(),
None
)
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentOwnerValue
(),
None
)
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentSiteValue
(),
None
)
# Place in a project
self
.
assertEqual
(
self
.
instance_tree
.
requestTransfer
(
destination
=
None
,
destination_project
=
project
.
getRelativeUrl
()),
None
)
self
.
tic
()
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentProjectValue
(),
project
)
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentOwnerValue
(),
destination_section
)
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentSiteValue
(),
None
)
self
.
assertEqual
(
1
,
len
(
self
.
instance_tree
.
getAggregateRelatedList
(
portal_type
=
"Internal Packing List Line"
))
)
# Ensure that we don't have 2 new Internal Packing lists in the same second
sleep
(
1
)
self
.
login
(
destination_section
.
getUserId
())
# We don't remove from Project if destination project is not provided
self
.
assertEqual
(
self
.
instance_tree
.
requestTransfer
(
destination
=
None
,
destination_project
=
None
),
None
)
self
.
tic
()
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentProjectValue
(),
project
)
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentOwnerValue
(),
destination_section
)
self
.
assertEqual
(
2
,
len
(
self
.
instance_tree
.
getAggregateRelatedList
(
portal_type
=
"Internal Packing List Line"
))
)
# Ensure that we don't have 2 new Internal Packing lists in the same second
sleep
(
1
)
# Place in another project
self
.
assertEqual
(
self
.
instance_tree
.
requestTransfer
(
destination
=
None
,
destination_project
=
other_project
.
getRelativeUrl
()),
None
)
self
.
tic
()
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentProjectValue
(),
other_project
)
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentOwnerValue
(),
destination_section
)
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentSiteValue
(),
None
)
self
.
assertEqual
(
3
,
len
(
self
.
instance_tree
.
getAggregateRelatedList
(
portal_type
=
"Internal Packing List Line"
))
)
self
.
login
(
destination_section
.
getUserId
())
# Ensure that we don't have 2 new Internal Packing lists in the same second
sleep
(
1
)
# We don't remove from Project if destination project is not provided
self
.
assertEqual
(
self
.
instance_tree
.
requestTransfer
(
destination_project
=
None
,
destination
=
None
),
None
)
self
.
tic
()
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentProjectValue
(),
other_project
)
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentOwnerValue
(),
destination_section
)
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentSiteValue
(),
None
)
self
.
assertEqual
(
4
,
len
(
self
.
instance_tree
.
getAggregateRelatedList
(
portal_type
=
"Internal Packing List Line"
))
)
def
test_RequesterInstance_requestTransfer_owner
(
self
):
destination_section
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
self
.
instance_tree
.
setDestinationSectionValue
(
destination_section
)
self
.
login
()
organisation
=
self
.
_makeOrganisation
()
other_organisation
=
self
.
_makeOrganisation
()
self
.
tic
()
self
.
login
(
destination_section
.
getUserId
())
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentProjectValue
(),
None
)
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentOwnerValue
(),
None
)
self
.
assertEqual
(
self
.
instance_tree
.
requestTransfer
(
destination
=
organisation
.
getRelativeUrl
(),
destination_project
=
None
),
None
)
self
.
tic
()
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentProjectValue
(),
None
)
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentOwnerValue
(),
destination_section
)
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentSiteValue
(),
organisation
)
self
.
assertEqual
(
1
,
len
(
self
.
instance_tree
.
getAggregateRelatedList
(
portal_type
=
"Internal Packing List Line"
))
)
# Ensure that we don't have 2 new Internal Packing lists in the same second
sleep
(
1
)
self
.
login
(
destination_section
.
getUserId
())
self
.
assertEqual
(
self
.
instance_tree
.
requestTransfer
(
destination_project
=
None
,
destination
=
None
),
None
)
self
.
tic
()
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentProjectValue
(),
None
)
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentOwnerValue
(),
destination_section
)
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentSiteValue
(),
organisation
)
# Ensure that we don't have 2 new Internal Packing lists in the same second
sleep
(
1
)
# Place in another project
self
.
assertEqual
(
self
.
instance_tree
.
requestTransfer
(
destination_project
=
None
,
destination
=
other_organisation
.
getRelativeUrl
()),
None
)
self
.
tic
()
self
.
assertEqual
(
3
,
len
(
self
.
instance_tree
.
getAggregateRelatedList
(
portal_type
=
"Internal Packing List Line"
))
)
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentProjectValue
(),
None
)
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentOwnerValue
(),
destination_section
)
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentSiteValue
(),
other_organisation
)
self
.
assertEqual
(
3
,
len
(
self
.
instance_tree
.
getAggregateRelatedList
(
portal_type
=
"Internal Packing List Line"
))
)
self
.
login
(
destination_section
.
getUserId
())
# Ensure that we don't have 2 new Internal Packing lists in the same second
sleep
(
1
)
# We don't remove from Project if destination project is not provided
self
.
assertEqual
(
self
.
instance_tree
.
requestTransfer
(
destination_project
=
None
,
destination
=
None
),
None
)
self
.
tic
()
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentProjectValue
(),
None
)
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentOwnerValue
(),
destination_section
)
self
.
assertEqual
(
self
.
instance_tree
.
Item_getCurrentSiteValue
(),
other_organisation
)
self
.
assertEqual
(
4
,
len
(
self
.
instance_tree
.
getAggregateRelatedList
(
portal_type
=
"Internal Packing List Line"
))
)
def
test_generateCertificate
(
self
):
self
.
login
()
self
.
software_instance
.
setSslKey
(
None
)
...
...
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