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
Labels
Merge Requests
21
Merge Requests
21
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
7ea040e5
Commit
7ea040e5
authored
Oct 09, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: test reopening suspended support request alarm
parent
52432e27
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
1 deletion
+72
-1
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
...ateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
+72
-0
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSCodingStyle.py
...Item/portal_components/test.erp5.testSlapOSCodingStyle.py
+0
-1
No files found.
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
View file @
7ea040e5
...
@@ -26,6 +26,7 @@ from DateTime import DateTime
...
@@ -26,6 +26,7 @@ from DateTime import DateTime
import
difflib
import
difflib
import
transaction
import
transaction
from
zExceptions
import
Unauthorized
from
zExceptions
import
Unauthorized
import
time
class
TestSlapOSCRMCreateRegularisationRequestAlarm
(
SlapOSTestCaseMixin
):
class
TestSlapOSCRMCreateRegularisationRequestAlarm
(
SlapOSTestCaseMixin
):
...
@@ -2164,3 +2165,74 @@ class TestSlaposCrmUpdateSupportRequestState(SlapOSTestCaseMixinWithAbort):
...
@@ -2164,3 +2165,74 @@ class TestSlaposCrmUpdateSupportRequestState(SlapOSTestCaseMixinWithAbort):
self
.
assertEqual
(
len
(
event_list
),
0
)
self
.
assertEqual
(
len
(
event_list
),
0
)
self
.
assertEqual
(
ticket
.
getSimulationState
(),
"invalidated"
)
self
.
assertEqual
(
ticket
.
getSimulationState
(),
"invalidated"
)
class
TestSlaposCrmCheckSuspendedSupportRequestToReopen
(
SlapOSTestCaseMixinWithAbort
):
def
_makeSupportRequest
(
self
):
support_request
=
self
.
portal
.
support_request_module
.
newContent
(
portal_type
=
"Support Request"
)
support_request
.
submit
()
new_id
=
self
.
generateNewId
()
support_request
.
edit
(
title
=
"Support Request éçà %s"
%
new_id
,
#pylint: disable=invalid-encoded-data
reference
=
"TESTSRQ-%s"
%
new_id
)
return
support_request
def
test_SupportRequest_checkSuspendedSupportRequestToReopen_alarm_suspended
(
self
):
support_request
=
self
.
_makeSupportRequest
()
support_request
.
validate
()
support_request
.
suspend
()
self
.
tic
()
alarm
=
self
.
portal
.
portal_alarms
.
\
slapos_crm_check_suspended_support_request_to_reopen
self
.
_test_alarm
(
alarm
,
support_request
,
"SupportRequest_checkSuspendedToReopen"
)
def
test_SupportRequest_checkSuspendedSupportRequestToReopen_alarm_notSuspended
(
self
):
support_request
=
self
.
_makeSupportRequest
()
support_request
.
validate
()
self
.
tic
()
alarm
=
self
.
portal
.
portal_alarms
.
\
slapos_crm_check_suspended_support_request_to_reopen
self
.
_test_alarm_not_visited
(
alarm
,
support_request
,
"SupportRequest_checkSuspendedToReopen"
)
def
_makeEvent
(
self
,
ticket
):
new_id
=
self
.
generateNewId
()
return
self
.
portal
.
event_module
.
newContent
(
portal_type
=
"Web Message"
,
title
=
'Test Event %s'
%
new_id
,
follow_up_value
=
ticket
)
def
test_SupportRequest_checkSuspendedSupportRequestToReopen_script_noEvent
(
self
):
support_request
=
self
.
_makeSupportRequest
()
support_request
.
validate
()
support_request
.
suspend
()
self
.
tic
()
support_request
.
SupportRequest_checkSuspendedToReopen
()
self
.
assertEqual
(
support_request
.
getSimulationState
(),
"suspended"
)
def
test_SupportRequest_checkSuspendedSupportRequestToReopen_script_recentEvent
(
self
):
support_request
=
self
.
_makeSupportRequest
()
support_request
.
validate
()
support_request
.
suspend
()
self
.
tic
()
time
.
sleep
(
1
)
self
.
_makeEvent
(
support_request
)
self
.
tic
()
support_request
.
SupportRequest_checkSuspendedToReopen
()
self
.
assertEqual
(
support_request
.
getSimulationState
(),
"validated"
)
def
test_SupportRequest_checkSuspendedSupportRequestToReopen_script_oldEvent
(
self
):
support_request
=
self
.
_makeSupportRequest
()
self
.
_makeEvent
(
support_request
)
self
.
tic
()
time
.
sleep
(
1
)
support_request
.
validate
()
support_request
.
suspend
()
self
.
tic
()
support_request
.
SupportRequest_checkSuspendedToReopen
()
self
.
assertEqual
(
support_request
.
getSimulationState
(),
"suspended"
)
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSCodingStyle.py
View file @
7ea040e5
...
@@ -117,7 +117,6 @@ def makeTestSlapOSCodingStyleTestCase(tested_business_template):
...
@@ -117,7 +117,6 @@ def makeTestSlapOSCodingStyleTestCase(tested_business_template):
'slapos_crm_monitoring/SupportRequestModule_exportMonitoringOPMLDescriptionList'
,
'slapos_crm_monitoring/SupportRequestModule_exportMonitoringOPMLDescriptionList'
,
'slapos_crm_monitoring/SupportRequestModule_getInstanceMessageList'
,
'slapos_crm_monitoring/SupportRequestModule_getInstanceMessageList'
,
'slapos_crm_monitoring/SupportRequestModule_getMonitoringOPMLDescriptionList'
,
'slapos_crm_monitoring/SupportRequestModule_getMonitoringOPMLDescriptionList'
,
'slapos_crm_monitoring/SupportRequest_checkSuspendedToReopen'
,
'slapos_crm_monitoring/SupportRequest_getInstanceMessageList'
,
'slapos_crm_monitoring/SupportRequest_getInstanceMessageList'
,
'slapos_crm_monitoring/SupportRequest_getInstanceMonitorUrl'
,
'slapos_crm_monitoring/SupportRequest_getInstanceMonitorUrl'
,
'slapos_crm_monitoring/SupportRequest_getMonitorUrl'
,
'slapos_crm_monitoring/SupportRequest_getMonitorUrl'
,
...
...
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