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
96eae07c
Commit
96eae07c
authored
Nov 10, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: test: ComputeNode_getTicketRelatedList was dropped
parent
5979e6fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
302 deletions
+8
-302
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
...ateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
+8
-302
No files found.
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
View file @
96eae07c
...
...
@@ -23,7 +23,8 @@
import
transaction
from
erp5.component.test.SlapOSTestCaseMixin
import
\
SlapOSTestCaseMixin
,
SlapOSTestCaseMixinWithAbort
SlapOSTestCaseMixin
,
SlapOSTestCaseMixinWithAbort
,
TemporaryAlarmScript
from
DateTime
import
DateTime
from
App.Common
import
rfc1123_date
...
...
@@ -56,7 +57,7 @@ class TestCRMSkinsMixin(SlapOSTestCaseMixinWithAbort):
assignment
.
open
()
return
assignment
def
_makeInstanceTree
(
self
):
def
_makeInstanceTree
(
self
,
project
):
person
=
self
.
portal
.
person_module
\
.
newContent
(
portal_type
=
"Person"
)
instance_tree
=
self
.
portal
\
...
...
@@ -67,7 +68,8 @@ class TestCRMSkinsMixin(SlapOSTestCaseMixinWithAbort):
instance_tree
.
edit
(
title
=
"Test hosting sub ticket %s"
%
new_id
,
reference
=
"TESTHST-%s"
%
new_id
,
destination_section_value
=
person
destination_section_value
=
person
,
follow_up_value
=
project
)
return
instance_tree
...
...
@@ -109,8 +111,9 @@ class TestSlapOSSupportRequestModule_getMonitoringUrlList(TestCRMSkinsMixin):
# We assume here that several objects created by others tests don't influentiate
# this test.
self
.
assertEqual
(
module
.
SupportRequestModule_getMonitoringUrlList
(),
[])
instance_tree
=
self
.
_makeInstanceTree
()
self
.
_makeSoftwareInstance
(
instance_tree
,
"https://xxx/"
)
with
TemporaryAlarmScript
(
self
.
portal
,
'Item_getSubscriptionStatus'
,
"'subscribed'"
):
instance_tree
=
self
.
_makeInstanceTree
(
self
.
project
)
self
.
_makeSoftwareInstance
(
instance_tree
,
"https://xxx/"
)
support_request
=
module
.
newContent
(
portal_type
=
"Support Request"
)
self
.
tic
()
...
...
@@ -156,303 +159,6 @@ class TestSlapOSSupportRequestModule_getMonitoringUrlList(TestCRMSkinsMixin):
self
.
tic
()
self
.
assertNotEqual
(
instance_tree
.
getSuccessorList
(),
[])
class
TestSlapOSComputeNode_getTicketRelatedList
(
TestCRMSkinsMixin
):
def
test_getTicketRelatedList_support_request_related_to_allocated_instance
(
self
):
document
=
self
.
_makeComputeNode
(
self
.
project
)[
0
]
self
.
_makeComplexComputeNode
(
self
.
project
)
ticket
=
self
.
portal
.
support_request_module
.
newContent
(
\
title
=
"Test Support Request %s"
%
self
.
new_id
)
ticket
.
setAggregateValue
(
self
.
start_requested_software_instance
.
getSpecialiseValue
())
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
# Not indexed yet
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
self
.
tic
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
ticket
.
submit
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
ticket
.
validate
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
ticket
.
suspend
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
ticket
.
invalidate
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
def
test_getTicketRelatedList_support_request_related_to_compute_node
(
self
):
document
=
self
.
_makeComputeNode
(
self
.
project
)[
0
]
ticket
=
self
.
portal
.
support_request_module
.
newContent
(
\
title
=
"Test Support Request %s"
%
self
.
new_id
)
ticket
.
setAggregateValue
(
document
)
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
# Not indexed yet
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
self
.
tic
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
ticket
.
submit
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
ticket
.
validate
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
ticket
.
suspend
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
ticket
.
invalidate
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
def
test_getTicketRelatedList_cancelled_support_request_related_to_allocated_instance
(
self
):
document
=
self
.
_makeComputeNode
(
self
.
project
)[
0
]
self
.
_makeComplexComputeNode
(
self
.
project
)
ticket
=
self
.
portal
.
support_request_module
.
newContent
(
\
title
=
"Test Support Request %s"
%
self
.
new_id
)
ticket
.
setAggregateValue
(
self
.
start_requested_software_instance
.
getSpecialiseValue
())
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
# Not indexed yet
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
self
.
tic
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
ticket
.
submit
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
ticket
.
cancel
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
def
test_getTicketRelatedList_cancelled_support_request_related_to_compute_node
(
self
):
document
=
self
.
_makeComputeNode
(
self
.
project
)[
0
]
ticket
=
self
.
portal
.
support_request_module
.
newContent
(
\
title
=
"Test Support Request %s"
%
self
.
new_id
)
ticket
.
setAggregateValue
(
document
)
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
# Not indexed yet
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
self
.
tic
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
ticket
.
submit
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
ticket
.
cancel
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
def
test_getTicketRelatedList_upgrade_decision_related_to_allocated_instance
(
self
):
document
=
self
.
_makeComputeNode
(
self
.
project
)[
0
]
self
.
_makeComplexComputeNode
(
self
.
project
)
def
newUpgradeDecision
():
ticket
=
self
.
portal
.
upgrade_decision_module
.
newContent
(
portal_type
=
'Upgrade Decision'
,
title
=
"Upgrade Decision Test %s"
%
self
.
new_id
,
reference
=
"TESTUD-%s"
%
self
.
new_id
)
ticket
.
immediateReindexObject
()
return
ticket
ticket
=
newUpgradeDecision
()
ticket
.
newContent
(
portal_type
=
"Upgrade Decision Line"
).
setAggregateValue
(
self
.
start_requested_software_instance
.
getSpecialiseValue
())
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
# Not indexed yet
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
self
.
tic
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
ticket
.
plan
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
ticket
.
confirm
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
ticket
.
start
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
ticket
.
stop
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
ticket
.
deliver
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
def
test_getTicketRelatedList_upgrade_decision_related_to_compute_node
(
self
):
document
=
self
.
_makeComputeNode
(
self
.
project
)[
0
]
def
newUpgradeDecision
():
ticket
=
self
.
portal
.
upgrade_decision_module
.
newContent
(
portal_type
=
'Upgrade Decision'
,
title
=
"Upgrade Decision Test %s"
%
self
.
new_id
,
reference
=
"TESTUD-%s"
%
self
.
new_id
)
ticket
.
immediateReindexObject
()
return
ticket
ticket
=
newUpgradeDecision
()
ticket
.
newContent
(
portal_type
=
"Upgrade Decision Line"
).
setAggregateValue
(
document
)
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
# Not indexed yet
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
self
.
tic
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
ticket
.
plan
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
ticket
.
confirm
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
ticket
.
start
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
ticket
.
stop
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
ticket
.
deliver
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
1
)
self
.
assertEqual
(
open_related_ticket_list
[
0
].
getUid
(),
ticket
.
getUid
())
def
test_getTicketRelatedList_cancelled_upgrade_decision_to_allocated_instance
(
self
):
document
=
self
.
_makeComputeNode
(
self
.
project
)[
0
]
self
.
_makeComplexComputeNode
(
self
.
project
)
def
newUpgradeDecision
():
ticket
=
self
.
portal
.
upgrade_decision_module
.
newContent
(
portal_type
=
'Upgrade Decision'
,
title
=
"Upgrade Decision Test %s"
%
self
.
new_id
,
reference
=
"TESTUD-%s"
%
self
.
new_id
)
ticket
.
immediateReindexObject
()
return
ticket
ticket
=
newUpgradeDecision
()
ticket
.
newContent
(
portal_type
=
"Upgrade Decision Line"
).
setAggregateValue
(
self
.
start_requested_software_instance
.
getSpecialiseValue
())
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
# Not indexed yet
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
self
.
tic
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
ticket
.
cancel
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
def
test_getTicketRelatedList_cancelled_upgrade_decision_to_computer_node
(
self
):
document
=
self
.
_makeComputeNode
(
self
.
project
)[
0
]
def
newUpgradeDecision
():
ticket
=
self
.
portal
.
upgrade_decision_module
.
newContent
(
portal_type
=
'Upgrade Decision'
,
title
=
"Upgrade Decision Test %s"
%
self
.
new_id
,
reference
=
"TESTUD-%s"
%
self
.
new_id
)
ticket
.
immediateReindexObject
()
return
ticket
ticket
=
newUpgradeDecision
()
ticket
.
newContent
(
portal_type
=
"Upgrade Decision Line"
).
setAggregateValue
(
document
)
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
# Not indexed yet
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
self
.
tic
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
ticket
.
cancel
()
ticket
.
immediateReindexObject
()
open_related_ticket_list
=
document
.
ComputeNode_getTicketRelatedList
()
self
.
assertEqual
(
len
(
open_related_ticket_list
),
0
)
class
TestComputeNode_hasContactedRecently
(
SlapOSTestCaseMixinWithAbort
):
...
...
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