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
Paul Graydon
slapos.core
Commits
573390ee
Commit
573390ee
authored
Mar 06, 2013
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate ticket invalidation alarm.
Regularisation Request are now used instead of Support Request.
parent
70d62bc0
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
152 additions
and
249 deletions
+152
-249
master/bt5/slapos_crm/PathTemplateItem/portal_alarms/slapos_crm_invalidate_suspended_regularisation_request.xml
...lapos_crm_invalidate_suspended_regularisation_request.xml
+3
-3
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/Alarm_invalidateSuspendedRegularisationRequest.xml
...os_crm/Alarm_invalidateSuspendedRegularisationRequest.xml
+3
-4
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm/RegularisationRequest_invalidateIfPersonBalanceIsOk.xml
...m/RegularisationRequest_invalidateIfPersonBalanceIsOk.xml
+14
-10
master/bt5/slapos_crm/TestTemplateItem/testSlapOSCRMAlarm.py
master/bt5/slapos_crm/TestTemplateItem/testSlapOSCRMAlarm.py
+63
-0
master/bt5/slapos_crm/TestTemplateItem/testSlapOSCRMSkins.py
master/bt5/slapos_crm/TestTemplateItem/testSlapOSCRMSkins.py
+66
-0
master/bt5/slapos_crm/bt/revision
master/bt5/slapos_crm/bt/revision
+1
-1
master/bt5/slapos_crm/bt/template_path_list
master/bt5/slapos_crm/bt/template_path_list
+1
-0
master/bt5/slapos_payzen/TestTemplateItem/testSlapOSPayzenAlarm.py
...5/slapos_payzen/TestTemplateItem/testSlapOSPayzenAlarm.py
+0
-229
master/bt5/slapos_payzen/bt/revision
master/bt5/slapos_payzen/bt/revision
+1
-1
master/bt5/slapos_payzen/bt/template_path_list
master/bt5/slapos_payzen/bt/template_path_list
+0
-1
No files found.
master/bt5/slapos_
payzen/PathTemplateItem/portal_alarms/slapos_payzen_update_suspended_support
_request.xml
→
master/bt5/slapos_
crm/PathTemplateItem/portal_alarms/slapos_crm_invalidate_suspended_regularisation
_request.xml
View file @
573390ee
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<dictionary>
<dictionary>
<item>
<item>
<key>
<string>
active_sense_method_id
</string>
</key>
<key>
<string>
active_sense_method_id
</string>
</key>
<value>
<string>
Alarm_
updatePayzenSuspendedSupport
Request
</string>
</value>
<value>
<string>
Alarm_
invalidateSuspendedRegularisation
Request
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
description
</string>
</key>
<key>
<string>
description
</string>
</key>
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
slapos_
payzen_update_suspended_support
_request
</string>
</value>
<value>
<string>
slapos_
crm_invalidate_suspended_regularisation
_request
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
periodicity_hour
</string>
</key>
<key>
<string>
periodicity_hour
</string>
</key>
...
@@ -95,7 +95,7 @@
...
@@ -95,7 +95,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
title
</string>
</key>
<key>
<string>
title
</string>
</key>
<value>
<string>
Handles suspended Support R
equest
</string>
</value>
<value>
<string>
Invalidate suspended regularisation r
equest
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
master/bt5/slapos_
payzen/SkinTemplateItem/portal_skins/slapos_payzen/Alarm_updatePayzenSuspendedSupport
Request.xml
→
master/bt5/slapos_
crm/SkinTemplateItem/portal_skins/slapos_crm/Alarm_invalidateSuspendedRegularisation
Request.xml
View file @
573390ee
...
@@ -52,10 +52,9 @@
...
@@ -52,10 +52,9 @@
<key>
<string>
_body
</string>
</key>
<key>
<string>
_body
</string>
</key>
<value>
<string>
portal = context.getPortalObject()\n
<value>
<string>
portal = context.getPortalObject()\n
portal.portal_catalog.searchAndActivate(\n
portal.portal_catalog.searchAndActivate(\n
portal_type="
Support
Request", \n
portal_type="
Regularisation
Request", \n
simulation_state=["suspended"],\n
simulation_state=["suspended"],\n
method_id=\'SupportRequest_updateStatus\',\n
method_id=\'RegularisationRequest_invalidateIfPersonBalanceIsOk\',\n
default_source_project_portal_type="Payment Transaction",\n
activate_kw={\'tag\': tag}\n
activate_kw={\'tag\': tag}\n
)\n
)\n
context.activate(after_tag=tag).getId()\n
context.activate(after_tag=tag).getId()\n
...
@@ -67,7 +66,7 @@ context.activate(after_tag=tag).getId()\n
...
@@ -67,7 +66,7 @@ context.activate(after_tag=tag).getId()\n
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
Alarm_
updatePayzenSuspendedSupport
Request
</string>
</value>
<value>
<string>
Alarm_
invalidateSuspendedRegularisation
Request
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
master/bt5/slapos_
payzen/SkinTemplateItem/portal_skins/slapos_payzen/SupportRequest_updateStatus
.xml
→
master/bt5/slapos_
crm/SkinTemplateItem/portal_skins/slapos_crm/RegularisationRequest_invalidateIfPersonBalanceIsOk
.xml
View file @
573390ee
...
@@ -50,27 +50,31 @@
...
@@ -50,27 +50,31 @@
</item>
</item>
<item>
<item>
<key>
<string>
_body
</string>
</key>
<key>
<string>
_body
</string>
</key>
<value>
<string>
# from DateTime import DateTime\n
<value>
<string
encoding=
"cdata"
>
<![CDATA[
portal = context.getPortalObject()\n
from zExceptions import Unauthorized\n
if REQUEST is not None:\n
raise Unauthorized\n
\n
\n
state = context.getSimulationState()\n
state = context.getSimulationState()\n
p
ayment = context.getSourceProjectValue(portal_type="Payment Transacti
on")\n
p
erson = context.getSourceProjectValue(portal_type="Pers
on")\n
if (state != \'suspended\') or \\\n
if (state != \'suspended\') or \\\n
(payment is None) or \\\n
(person is None) or \\\n
(payment.getPaymentMode() != \'payzen\') or \\\n
(int(person.Entity_statBalance()) >
0):\n
(payment.getSimulationState() not in ("cancelled", "stopped", "delivered")):\n
return\n
return\n
else:\n
else:\n
context.invalidate(comment="Payzen payment state is %s" % payment.getSimulationState())\n
context.invalidate(comment="Automatically disabled as balance is %s" % person.Entity_statBalance())\n
</string>
</value>
]]>
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
<value>
<string>
REQUEST=None
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
SupportRequest_updateStatus
</string>
</value>
<value>
<string>
RegularisationRequest_invalidateIfPersonBalanceIsOk
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
master/bt5/slapos_crm/TestTemplateItem/testSlapOSCRMAlarm.py
View file @
573390ee
...
@@ -111,3 +111,66 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P
...
@@ -111,3 +111,66 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P
'Visited by Person_checkToCreateRegularisationRequest'
,
'Visited by Person_checkToCreateRegularisationRequest'
,
person
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
person
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
class
TestSlapOSCrmInvalidateSuspendedRegularisationRequest
(
testSlapOSMixin
):
def
beforeTearDown
(
self
):
transaction
.
abort
()
def
createRegularisationRequest
(
self
):
new_id
=
self
.
generateNewId
()
return
self
.
portal
.
regularisation_request_module
.
newContent
(
portal_type
=
'Regularisation Request'
,
title
=
"Test Reg. Req.%s"
%
new_id
,
reference
=
"TESTREGREQ-%s"
%
new_id
,
)
def
_simulateRegularisationRequest_invalidateIfPersonBalanceIsOk
(
self
):
script_name
=
'RegularisationRequest_invalidateIfPersonBalanceIsOk'
if
script_name
in
self
.
portal
.
portal_skins
.
custom
.
objectIds
():
raise
ValueError
(
'Precondition failed: %s exists in custom'
%
script_name
)
createZODBPythonScript
(
self
.
portal
.
portal_skins
.
custom
,
script_name
,
'*args, **kwargs'
,
'# Script body
\
n
'
"""portal_workflow = context.portal_workflow
portal_workflow.doActionFor(context, action='edit_action', comment='Visited by RegularisationRequest_invalidateIfPersonBalanceIsOk') """
)
transaction
.
commit
()
def
_dropRegularisationRequest_invalidateIfPersonBalanceIsOk
(
self
):
script_name
=
'RegularisationRequest_invalidateIfPersonBalanceIsOk'
if
script_name
in
self
.
portal
.
portal_skins
.
custom
.
objectIds
():
self
.
portal
.
portal_skins
.
custom
.
manage_delObjects
(
script_name
)
transaction
.
commit
()
def
test_alarm_not_suspended_regularisation_request
(
self
):
ticket
=
self
.
createRegularisationRequest
()
ticket
.
validate
()
self
.
tic
()
self
.
_simulateRegularisationRequest_invalidateIfPersonBalanceIsOk
()
try
:
self
.
portal
.
portal_alarms
.
\
slapos_crm_invalidate_suspended_regularisation_request
.
activeSense
()
self
.
tic
()
finally
:
self
.
_dropRegularisationRequest_invalidateIfPersonBalanceIsOk
()
self
.
assertNotEqual
(
'Visited by RegularisationRequest_invalidateIfPersonBalanceIsOk'
,
ticket
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
def
test_alarm_suspended_regularisation_request
(
self
):
ticket
=
self
.
createRegularisationRequest
()
ticket
.
validate
()
ticket
.
suspend
()
self
.
tic
()
self
.
_simulateRegularisationRequest_invalidateIfPersonBalanceIsOk
()
try
:
self
.
portal
.
portal_alarms
.
\
slapos_crm_invalidate_suspended_regularisation_request
.
activeSense
()
self
.
tic
()
finally
:
self
.
_dropRegularisationRequest_invalidateIfPersonBalanceIsOk
()
self
.
assertEqual
(
'Visited by RegularisationRequest_invalidateIfPersonBalanceIsOk'
,
ticket
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
master/bt5/slapos_crm/TestTemplateItem/testSlapOSCRMSkins.py
View file @
573390ee
...
@@ -151,3 +151,69 @@ The slapos team
...
@@ -151,3 +151,69 @@ The slapos team
person
.
Person_checkToCreateRegularisationRequest
,
person
.
Person_checkToCreateRegularisationRequest
,
REQUEST
=
{})
REQUEST
=
{})
class
TestSlapOSRegularisationRequest_invalidateIfPersonBalanceIsOk
(
testSlapOSMixin
):
def
beforeTearDown
(
self
):
transaction
.
abort
()
def
createPerson
(
self
):
new_id
=
self
.
generateNewId
()
return
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
title
=
"Person %s"
%
new_id
,
reference
=
"TESTPERS-%s"
%
new_id
,
)
def
createRegularisationRequest
(
self
):
new_id
=
self
.
generateNewId
()
return
self
.
portal
.
regularisation_request_module
.
newContent
(
portal_type
=
'Regularisation Request'
,
title
=
"Test Reg. Req.%s"
%
new_id
,
reference
=
"TESTREGREQ-%s"
%
new_id
,
)
def
test_invalidateIfPersonBalanceIsOk_REQUEST_disallowed
(
self
):
ticket
=
self
.
createRegularisationRequest
()
self
.
assertRaises
(
Unauthorized
,
ticket
.
RegularisationRequest_invalidateIfPersonBalanceIsOk
,
REQUEST
=
{})
@
simulate
(
'Entity_statBalance'
,
'*args, **kwargs'
,
'return "0"'
)
def
test_invalidateIfPersonBalanceIsOk_matching_case
(
self
):
person
=
self
.
createPerson
()
ticket
=
self
.
createRegularisationRequest
()
ticket
.
edit
(
source_project_value
=
person
)
ticket
.
validate
()
ticket
.
suspend
()
ticket
.
RegularisationRequest_invalidateIfPersonBalanceIsOk
()
self
.
assertEquals
(
ticket
.
getSimulationState
(),
'invalidated'
)
@
simulate
(
'Entity_statBalance'
,
'*args, **kwargs'
,
'return "0"'
)
def
test_invalidateIfPersonBalanceIsOk_not_suspended
(
self
):
person
=
self
.
createPerson
()
ticket
=
self
.
createRegularisationRequest
()
ticket
.
edit
(
source_project_value
=
person
)
ticket
.
validate
()
ticket
.
RegularisationRequest_invalidateIfPersonBalanceIsOk
()
self
.
assertEquals
(
ticket
.
getSimulationState
(),
'validated'
)
@
simulate
(
'Entity_statBalance'
,
'*args, **kwargs'
,
'return "0"'
)
def
test_invalidateIfPersonBalanceIsOk_no_person
(
self
):
ticket
=
self
.
createRegularisationRequest
()
ticket
.
validate
()
ticket
.
suspend
()
ticket
.
RegularisationRequest_invalidateIfPersonBalanceIsOk
()
self
.
assertEquals
(
ticket
.
getSimulationState
(),
'suspended'
)
@
simulate
(
'Entity_statBalance'
,
'*args, **kwargs'
,
'return "1"'
)
def
test_invalidateIfPersonBalanceIsOk_wrong_balance
(
self
):
person
=
self
.
createPerson
()
ticket
=
self
.
createRegularisationRequest
()
ticket
.
edit
(
source_project_value
=
person
)
ticket
.
validate
()
ticket
.
suspend
()
ticket
.
RegularisationRequest_invalidateIfPersonBalanceIsOk
()
self
.
assertEquals
(
ticket
.
getSimulationState
(),
'suspended'
)
master/bt5/slapos_crm/bt/revision
View file @
573390ee
11
12
\ No newline at end of file
\ No newline at end of file
master/bt5/slapos_crm/bt/template_path_list
View file @
573390ee
event_module/slapos_crm_web_message_template
event_module/slapos_crm_web_message_template
portal_alarms/slapos_crm_create_regularisation_request
portal_alarms/slapos_crm_create_regularisation_request
portal_alarms/slapos_crm_invalidate_suspended_regularisation_request
regularisation_request_module/slapos_crm_regularisation_request_template
regularisation_request_module/slapos_crm_regularisation_request_template
service_module/slapos_crm_acknowledgement
service_module/slapos_crm_acknowledgement
service_module/slapos_crm_complaint
service_module/slapos_crm_complaint
...
...
master/bt5/slapos_payzen/TestTemplateItem/testSlapOSPayzenAlarm.py
View file @
573390ee
...
@@ -463,232 +463,3 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P
...
@@ -463,232 +463,3 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P
'Visited by PaymentTransaction_updateStatus'
,
'Visited by PaymentTransaction_updateStatus'
,
transaction
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
transaction
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
class
TestSlapOSPayzenUpdateSuspendedSupportRequest
(
testSlapOSMixin
):
def
beforeTearDown
(
self
):
transaction
.
abort
()
def
test_not_suspended_support_request
(
self
):
new_id
=
self
.
generateNewId
()
payment
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
'Payment Transaction'
,
title
=
"Payment %s"
%
new_id
,
reference
=
"TESTPAY-%s"
%
new_id
,
payment_mode
=
"payzen"
,
)
payment
.
cancel
()
new_id
=
self
.
generateNewId
()
ticket
=
self
.
portal
.
support_request_module
.
newContent
(
portal_type
=
'Support Request'
,
title
=
"Ticket %s"
%
new_id
,
reference
=
"TESTSUPREQ-%s"
%
new_id
,
source_project_value
=
payment
,
)
simulation_state
=
ticket
.
getSimulationState
()
modification_date
=
ticket
.
getModificationDate
()
ticket
.
SupportRequest_updateStatus
()
self
.
assertEquals
(
ticket
.
getSimulationState
(),
simulation_state
)
self
.
assertEquals
(
ticket
.
getModificationDate
(),
modification_date
)
def
test_not_payzen_payment_support_request
(
self
):
new_id
=
self
.
generateNewId
()
payment
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
'Payment Transaction'
,
title
=
"Payment %s"
%
new_id
,
reference
=
"TESTPAY-%s"
%
new_id
,
)
payment
.
cancel
()
new_id
=
self
.
generateNewId
()
ticket
=
self
.
portal
.
support_request_module
.
newContent
(
portal_type
=
'Support Request'
,
title
=
"Ticket %s"
%
new_id
,
reference
=
"TESTSUPREQ-%s"
%
new_id
,
source_project_value
=
payment
,
)
ticket
.
validate
()
ticket
.
suspend
()
simulation_state
=
ticket
.
getSimulationState
()
modification_date
=
ticket
.
getModificationDate
()
ticket
.
SupportRequest_updateStatus
()
self
.
assertEquals
(
ticket
.
getSimulationState
(),
simulation_state
)
self
.
assertEquals
(
ticket
.
getModificationDate
(),
modification_date
)
def
test_not_finalyzed_payment_support_request
(
self
):
new_id
=
self
.
generateNewId
()
payment
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
'Payment Transaction'
,
title
=
"Payment %s"
%
new_id
,
reference
=
"TESTPAY-%s"
%
new_id
,
payment_mode
=
"payzen"
,
)
payment
.
start
()
new_id
=
self
.
generateNewId
()
ticket
=
self
.
portal
.
support_request_module
.
newContent
(
portal_type
=
'Support Request'
,
title
=
"Ticket %s"
%
new_id
,
reference
=
"TESTSUPREQ-%s"
%
new_id
,
source_project_value
=
payment
,
)
ticket
.
validate
()
ticket
.
suspend
()
simulation_state
=
ticket
.
getSimulationState
()
modification_date
=
ticket
.
getModificationDate
()
ticket
.
SupportRequest_updateStatus
()
self
.
assertEquals
(
ticket
.
getSimulationState
(),
simulation_state
)
self
.
assertEquals
(
ticket
.
getModificationDate
(),
modification_date
)
def
test_no_payment_support_request
(
self
):
new_id
=
self
.
generateNewId
()
ticket
=
self
.
portal
.
support_request_module
.
newContent
(
portal_type
=
'Support Request'
,
title
=
"Ticket %s"
%
new_id
,
reference
=
"TESTSUPREQ-%s"
%
new_id
,
)
ticket
.
validate
()
ticket
.
suspend
()
simulation_state
=
ticket
.
getSimulationState
()
modification_date
=
ticket
.
getModificationDate
()
ticket
.
SupportRequest_updateStatus
()
self
.
assertEquals
(
ticket
.
getSimulationState
(),
simulation_state
)
self
.
assertEquals
(
ticket
.
getModificationDate
(),
modification_date
)
def
test_cancel_payment_support_request
(
self
):
new_id
=
self
.
generateNewId
()
payment
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
'Payment Transaction'
,
title
=
"Payment %s"
%
new_id
,
reference
=
"TESTPAY-%s"
%
new_id
,
payment_mode
=
"payzen"
,
)
payment
.
cancel
()
new_id
=
self
.
generateNewId
()
ticket
=
self
.
portal
.
support_request_module
.
newContent
(
portal_type
=
'Support Request'
,
title
=
"Ticket %s"
%
new_id
,
reference
=
"TESTSUPREQ-%s"
%
new_id
,
source_project_value
=
payment
,
)
ticket
.
validate
()
ticket
.
suspend
()
ticket
.
SupportRequest_updateStatus
()
self
.
assertEquals
(
ticket
.
getSimulationState
(),
"invalidated"
)
def
test_closed_payment_support_request
(
self
):
new_id
=
self
.
generateNewId
()
payment
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
'Payment Transaction'
,
title
=
"Payment %s"
%
new_id
,
reference
=
"TESTPAY-%s"
%
new_id
,
payment_mode
=
"payzen"
,
)
_jumpToStateFor
=
self
.
portal
.
portal_workflow
.
_jumpToStateFor
_jumpToStateFor
(
payment
,
"stopped"
)
new_id
=
self
.
generateNewId
()
ticket
=
self
.
portal
.
support_request_module
.
newContent
(
portal_type
=
'Support Request'
,
title
=
"Ticket %s"
%
new_id
,
reference
=
"TESTSUPREQ-%s"
%
new_id
,
source_project_value
=
payment
,
)
ticket
.
validate
()
ticket
.
suspend
()
ticket
.
SupportRequest_updateStatus
()
self
.
assertEquals
(
ticket
.
getSimulationState
(),
"invalidated"
)
def
_simulateSupportRequest_updateStatus
(
self
):
script_name
=
'SupportRequest_updateStatus'
if
script_name
in
self
.
portal
.
portal_skins
.
custom
.
objectIds
():
raise
ValueError
(
'Precondition failed: %s exists in custom'
%
script_name
)
createZODBPythonScript
(
self
.
portal
.
portal_skins
.
custom
,
script_name
,
'*args, **kwargs'
,
'# Script body
\
n
'
"""portal_workflow = context.portal_workflow
portal_workflow.doActionFor(context, action='edit_action', comment='Visited by SupportRequest_updateStatus') """
)
transaction
.
commit
()
def
_dropSupportRequest_updateStatus
(
self
):
script_name
=
'SupportRequest_updateStatus'
if
script_name
in
self
.
portal
.
portal_skins
.
custom
.
objectIds
():
self
.
portal
.
portal_skins
.
custom
.
manage_delObjects
(
script_name
)
transaction
.
commit
()
def
test_alarm_no_payment_support_request
(
self
):
new_id
=
self
.
generateNewId
()
ticket
=
self
.
portal
.
support_request_module
.
newContent
(
portal_type
=
'Support Request'
,
title
=
"Ticket %s"
%
new_id
,
reference
=
"TESTSUPREQ-%s"
%
new_id
,
)
ticket
.
validate
()
ticket
.
suspend
()
self
.
tic
()
self
.
_simulateSupportRequest_updateStatus
()
try
:
self
.
portal
.
portal_alarms
.
\
slapos_payzen_update_suspended_support_request
.
activeSense
()
self
.
tic
()
finally
:
self
.
_dropSupportRequest_updateStatus
()
self
.
assertNotEqual
(
'Visited by SupportRequest_updateStatus'
,
ticket
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
def
test_alarm_not_suspended_support_request
(
self
):
new_id
=
self
.
generateNewId
()
payment
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
'Payment Transaction'
,
title
=
"Payment %s"
%
new_id
,
reference
=
"TESTPAY-%s"
%
new_id
,
)
new_id
=
self
.
generateNewId
()
ticket
=
self
.
portal
.
support_request_module
.
newContent
(
portal_type
=
'Support Request'
,
title
=
"Ticket %s"
%
new_id
,
reference
=
"TESTSUPREQ-%s"
%
new_id
,
source_project_value
=
payment
,
)
ticket
.
validate
()
self
.
tic
()
self
.
_simulateSupportRequest_updateStatus
()
try
:
self
.
portal
.
portal_alarms
.
\
slapos_payzen_update_suspended_support_request
.
activeSense
()
self
.
tic
()
finally
:
self
.
_dropSupportRequest_updateStatus
()
self
.
assertNotEqual
(
'Visited by SupportRequest_updateStatus'
,
ticket
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
def
test_alarm_suspended_support_request
(
self
):
new_id
=
self
.
generateNewId
()
payment
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
'Payment Transaction'
,
title
=
"Payment %s"
%
new_id
,
reference
=
"TESTPAY-%s"
%
new_id
,
)
new_id
=
self
.
generateNewId
()
ticket
=
self
.
portal
.
support_request_module
.
newContent
(
portal_type
=
'Support Request'
,
title
=
"Ticket %s"
%
new_id
,
reference
=
"TESTSUPREQ-%s"
%
new_id
,
source_project_value
=
payment
,
)
ticket
.
validate
()
ticket
.
suspend
()
self
.
tic
()
self
.
_simulateSupportRequest_updateStatus
()
try
:
self
.
portal
.
portal_alarms
.
\
slapos_payzen_update_suspended_support_request
.
activeSense
()
self
.
tic
()
finally
:
self
.
_dropSupportRequest_updateStatus
()
self
.
assertEqual
(
'Visited by SupportRequest_updateStatus'
,
ticket
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
master/bt5/slapos_payzen/bt/revision
View file @
573390ee
114
115
\ No newline at end of file
\ No newline at end of file
master/bt5/slapos_payzen/bt/template_path_list
View file @
573390ee
...
@@ -2,7 +2,6 @@ accounting_module/template_sale_invoice_transaction
...
@@ -2,7 +2,6 @@ accounting_module/template_sale_invoice_transaction
accounting_module/template_sale_invoice_transaction/**
accounting_module/template_sale_invoice_transaction/**
portal_alarms/slapos_payzen_update_confirmed_payment
portal_alarms/slapos_payzen_update_confirmed_payment
portal_alarms/slapos_payzen_update_started_payment
portal_alarms/slapos_payzen_update_started_payment
portal_alarms/slapos_payzen_update_suspended_support_request
portal_alarms/slapos_trigger_payment_transaction_order_builder
portal_alarms/slapos_trigger_payment_transaction_order_builder
portal_integrations/slapos_payzen_test_integration
portal_integrations/slapos_payzen_test_integration
portal_integrations/slapos_payzen_test_integration/Causality
portal_integrations/slapos_payzen_test_integration/Causality
...
...
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