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
8ef01760
Commit
8ef01760
authored
Oct 09, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: test reopening suspended supprot request alarm
parent
2e08776e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
0 deletions
+72
-0
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
...ateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
+72
-0
No files found.
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
View file @
8ef01760
...
@@ -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"
)
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