Commit f721ab44 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_crm: Fix up test, alarm is only call for Support Request associated to...

slapos_crm: Fix up test, alarm is only call for Support Request associated to a Hosting Subscription
parent 7c493839
......@@ -1321,6 +1321,22 @@ class TestSlaposCrmUpdateSupportRequestState(SlapOSTestCaseMixin):
return support_request
def _makeHostingSubscription(self):
person = self.portal.person_module.template_member\
.Base_createCloneDocument(batch_mode=1)
hosting_subscription = self.portal\
.hosting_subscription_module.template_hosting_subscription\
.Base_createCloneDocument(batch_mode=1)
hosting_subscription.validate()
new_id = self.generateNewId()
hosting_subscription.edit(
title= "Test hosting sub ticket %s" % new_id,
reference="TESTHST-%s" % new_id,
destination_section_value=person,
monitor_scope="enabled"
)
return hosting_subscription
def _simulateSupportRequest_updateMonitoringState(self):
script_name = 'SupportRequest_updateMonitoringState'
......@@ -1342,6 +1358,8 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by S
def test_alarm_update_support_request_state(self):
support_request = self._makeSupportRequest()
hs = self._makeHostingSubscription()
support_request.setAggregateValue(hs)
self.tic()
self._simulateSupportRequest_updateMonitoringState()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment