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
0
Merge Requests
0
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
Titouan Soulard
slapos.core
Commits
c44f7fd5
Commit
c44f7fd5
authored
Sep 13, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: test slapos_crm_update_support_request_state
parent
6e551a7b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
6 deletions
+29
-6
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_updateSupportRequestMonitoringState.py
...m_monitoring/Alarm_updateSupportRequestMonitoringState.py
+3
-3
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
...ateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
+26
-3
No files found.
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_updateSupportRequestMonitoringState.py
View file @
c44f7fd5
...
...
@@ -4,10 +4,10 @@ default_resource_uid = portal.restrictedTraverse("service_module/slapos_crm_moni
portal
.
portal_catalog
.
searchAndActivate
(
portal_type
=
'Support Request'
,
simulation_state
=
[
'validated'
,
'suspended'
],
default_resource
_uid
=
default_resource_uid
,
default_aggregate
_portal_type
=
[
"Instance Tree"
],
resource_
_uid
=
default_resource_uid
,
aggregate_
_portal_type
=
[
"Instance Tree"
],
method_id
=
'SupportRequest_updateMonitoringState'
,
activate_kw
=
{
'tag'
:
tag
}
activate_kw
=
{
'tag'
:
tag
}
)
context
.
activate
(
after_tag
=
tag
).
getId
()
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
View file @
c44f7fd5
...
...
@@ -627,9 +627,13 @@ class TestSlaposCrmUpdateSupportRequestState(SlapOSTestCaseMixinWithAbort):
def
_makeSupportRequest
(
self
):
person
=
self
.
portal
.
person_module
.
template_member
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
"""
support_request = self.portal.restrictedTraverse(
self.portal.portal_preferences.getPreferredSupportRequestTemplate()).
\
Base_createCloneDocument
(
batch_mode
=
1
)
Base_createCloneDocument(batch_mode=1)"""
support_request
=
self
.
portal
.
support_request_module
.
newContent
(
portal_type
=
"Support Request"
)
support_request
.
validate
()
new_id
=
self
.
generateNewId
()
support_request
.
edit
(
...
...
@@ -657,7 +661,7 @@ class TestSlaposCrmUpdateSupportRequestState(SlapOSTestCaseMixinWithAbort):
return
instance_tree
def
test_
updateSupportRequestState
_monitoring
(
self
):
def
test_
SupportRequest_updateMonitoringState_alarm
_monitoring
(
self
):
support_request
=
self
.
_makeSupportRequest
()
support_request
.
setResource
(
"service_module/slapos_crm_monitoring"
)
hs
=
self
.
_makeInstanceTree
()
...
...
@@ -667,7 +671,7 @@ class TestSlaposCrmUpdateSupportRequestState(SlapOSTestCaseMixinWithAbort):
slapos_crm_update_support_request_state
self
.
_test_alarm
(
alarm
,
support_request
,
"SupportRequest_updateMonitoringState"
)
def
test_
updateSupportRequestState_not_monitoring
(
self
):
def
test_
SupportRequest_updateMonitoringState_alarm_notResource
(
self
):
support_request
=
self
.
_makeSupportRequest
()
hs
=
self
.
_makeInstanceTree
()
support_request
.
setAggregateValue
(
hs
)
...
...
@@ -676,6 +680,25 @@ class TestSlaposCrmUpdateSupportRequestState(SlapOSTestCaseMixinWithAbort):
slapos_crm_update_support_request_state
self
.
_test_alarm_not_visited
(
alarm
,
support_request
,
"SupportRequest_updateMonitoringState"
)
def
test_SupportRequest_updateMonitoringState_alarm_notValidated
(
self
):
support_request
=
self
.
_makeSupportRequest
()
support_request
.
setResource
(
"service_module/slapos_crm_monitoring"
)
support_request
.
invalidate
()
hs
=
self
.
_makeInstanceTree
()
support_request
.
setAggregateValue
(
hs
)
self
.
tic
()
alarm
=
self
.
portal
.
portal_alarms
.
\
slapos_crm_update_support_request_state
self
.
_test_alarm_not_visited
(
alarm
,
support_request
,
"SupportRequest_updateMonitoringState"
)
def
test_SupportRequest_updateMonitoringState_alarm_noInstanceTree
(
self
):
support_request
=
self
.
_makeSupportRequest
()
support_request
.
setResource
(
"service_module/slapos_crm_monitoring"
)
self
.
tic
()
alarm
=
self
.
portal
.
portal_alarms
.
\
slapos_crm_update_support_request_state
self
.
_test_alarm_not_visited
(
alarm
,
support_request
,
"SupportRequest_updateMonitoringState"
)
class
TestSlaposCrmSendPendingTicket_reminder
(
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