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
526864c7
Commit
526864c7
authored
Sep 29, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: fixup InstanceTree_deleteFromRegularisationRequest tests
parent
195eb4cd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
11 deletions
+14
-11
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/InstanceTree_deleteFromRegularisationRequest.py
...lapos_crm/InstanceTree_deleteFromRegularisationRequest.py
+2
-1
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMRegularisationRequestSkins.py
...ents/test.erp5.testSlapOSCRMRegularisationRequestSkins.py
+12
-10
No files found.
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/InstanceTree_deleteFromRegularisationRequest.py
View file @
526864c7
...
...
@@ -15,7 +15,8 @@ if (slap_state in ['start_requested', 'stop_requested']):
software_type
=
instance_tree
.
getSourceReference
(),
instance_xml
=
instance_tree
.
getTextContent
(),
sla_xml
=
instance_tree
.
getSlaXml
(),
shared
=
instance_tree
.
isRootSlave
()
shared
=
instance_tree
.
isRootSlave
(),
project_reference
=
instance_tree
.
getFollowUpReference
()
)
return
True
return
False
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMRegularisationRequestSkins.py
View file @
526864c7
...
...
@@ -496,29 +496,30 @@ class TestSlapOSInstanceTree_stopFromRegularisationRequest(
class
TestSlapOSInstanceTree_deleteFromRegularisationRequest
(
SlapOSTestCaseMixinWithAbort
):
def
createInstanceTree
(
self
):
def
createInstanceTree
(
self
,
project
):
new_id
=
self
.
generateNewId
()
instance_tree
=
self
.
portal
.
instance_tree_module
\
.
template_instance_tree
.
Base_createCloneDocument
(
batch_mode
=
1
)
instance_tree
.
edit
(
reference
=
"TESTHS-%s"
%
new_id
,
follow_up_value
=
project
)
instance_tree
.
validate
()
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
instance_tree
,
'start_requested'
)
return
instance_tree
def
test_deleteFromRegularisationRequest_REQUEST
_
disallowed
(
self
):
def
test_deleteFromRegularisationRequest_REQUESTdisallowed
(
self
):
self
.
assertRaises
(
Unauthorized
,
self
.
portal
.
InstanceTree_deleteFromRegularisationRequest
,
''
,
REQUEST
=
{})
def
test_deleteFromRegularisationRequest_started
_s
ubscription
(
self
):
def
test_deleteFromRegularisationRequest_started
S
ubscription
(
self
):
project
=
self
.
addProject
()
person
=
self
.
makePerson
(
project
,
index
=
0
,
user
=
0
)
instance_tree
=
self
.
createInstanceTree
()
instance_tree
=
self
.
createInstanceTree
(
project
)
instance_tree
.
edit
(
destination_section
=
person
.
getRelativeUrl
(),
)
...
...
@@ -544,10 +545,10 @@ class TestSlapOSInstanceTree_deleteFromRegularisationRequest(
self
.
assertEqual
(
instance_tree
.
isRootSlave
(),
shared
)
self
.
assertEqual
(
instance_tree
.
getSlapState
(),
"destroy_requested"
)
def
test_deleteFromRegularisationRequest_stopped
_s
ubscription
(
self
):
def
test_deleteFromRegularisationRequest_stopped
S
ubscription
(
self
):
project
=
self
.
addProject
()
person
=
self
.
makePerson
(
project
,
index
=
0
,
user
=
0
)
instance_tree
=
self
.
createInstanceTree
()
instance_tree
=
self
.
createInstanceTree
(
project
)
instance_tree
.
edit
(
destination_section
=
person
.
getRelativeUrl
(),
)
...
...
@@ -575,10 +576,10 @@ class TestSlapOSInstanceTree_deleteFromRegularisationRequest(
self
.
assertEqual
(
instance_tree
.
isRootSlave
(),
shared
)
self
.
assertEqual
(
instance_tree
.
getSlapState
(),
"destroy_requested"
)
def
test_deleteFromRegularisationRequest_destroyed
_s
ubscription
(
self
):
def
test_deleteFromRegularisationRequest_destroyed
S
ubscription
(
self
):
project
=
self
.
addProject
()
person
=
self
.
makePerson
(
project
,
index
=
0
,
user
=
0
)
instance_tree
=
self
.
createInstanceTree
()
instance_tree
=
self
.
createInstanceTree
(
project
)
instance_tree
.
edit
(
destination_section
=
person
.
getRelativeUrl
(),
)
...
...
@@ -590,8 +591,9 @@ class TestSlapOSInstanceTree_deleteFromRegularisationRequest(
self
.
assertEqual
(
result
,
False
)
def
test_deleteFromRegularisationRequest_non_matching_person
(
self
):
instance_tree
=
self
.
createInstanceTree
()
def
test_deleteFromRegularisationRequest_nonMatchingPerson
(
self
):
project
=
self
.
addProject
()
instance_tree
=
self
.
createInstanceTree
(
project
)
self
.
assertRaises
(
AssertionError
,
instance_tree
.
InstanceTree_deleteFromRegularisationRequest
,
...
...
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