Commit cc4a6ab3 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_rss_style: Include proper suffix on the messages

   Insert suffix on RSS Entry title, to better indicate what is the notification is about.

   MONITORING was widely used already, so it drops the need for custom entries.
parent 04a04c71
...@@ -56,7 +56,7 @@ for brain in portal.portal_catalog( ...@@ -56,7 +56,7 @@ for brain in portal.portal_catalog(
data_list.append( data_list.append(
Object(**{ Object(**{
'title': ticket_title, 'title': "[%s] %s" % (ticket_category.upper(), ticket_title),
'category': ticket_category, 'category': ticket_category,
'author': event.getSourceTitle(checked_permission="View"), 'author': event.getSourceTitle(checked_permission="View"),
'link': ticket_link, 'link': ticket_link,
......
...@@ -61,10 +61,19 @@ class TestRSSSyleSkinsMixin(SlapOSTestCaseMixinWithAbort): ...@@ -61,10 +61,19 @@ class TestRSSSyleSkinsMixin(SlapOSTestCaseMixinWithAbort):
destination_decision_value = self.makePerson(self.addProject()) destination_decision_value = self.makePerson(self.addProject())
else: else:
destination_decision_value = person destination_decision_value = person
software_product = self.portal.software_product_module.newContent(
portal_type='Software Product',
title='Theia IDE',
follow_up_value=project)
software_product.validate()
software_product.publish()
ticket = self.portal.upgrade_decision_module.newContent( ticket = self.portal.upgrade_decision_module.newContent(
portal_type='Upgrade Decision', portal_type='Upgrade Decision',
title="Upgrade Decision Test %s" % self.new_id, title="Upgrade Decision Test %s" % self.new_id,
reference="TESTUD-%s" % self.new_id, reference="TESTUD-%s" % self.new_id,
resource_value=software_product,
destination_value=destination_decision_value, destination_value=destination_decision_value,
destination_decision_value=destination_decision_value, destination_decision_value=destination_decision_value,
destination_project_value=project, destination_project_value=project,
...@@ -89,12 +98,13 @@ class TestRSSSyleSkinsMixin(SlapOSTestCaseMixinWithAbort): ...@@ -89,12 +98,13 @@ class TestRSSSyleSkinsMixin(SlapOSTestCaseMixinWithAbort):
title="Test Reg. Req.%s" % self.new_id, title="Test Reg. Req.%s" % self.new_id,
reference="TESTREGREQ-%s" % self.new_id, reference="TESTREGREQ-%s" % self.new_id,
destination_value=person, destination_value=person,
destination_decision_value=person destination_decision_value=person,
resource='service_module/slapos_crm_acknowledgement'
) )
ticket.Ticket_createProjectEvent( ticket.Ticket_createProjectEvent(
ticket.getTitle(), 'outgoing', 'Web Message', ticket.getTitle(), 'outgoing', 'Web Message',
'service_module/slapos_crm_monitoring', 'service_module/slapos_crm_acknowledgement',
text_content=ticket.getTitle(), text_content=ticket.getTitle(),
content_type='text/plain' content_type='text/plain'
) )
...@@ -246,7 +256,7 @@ class TestSlapOSWebSection_getEventList(TestRSSSyleSkinsMixin): ...@@ -246,7 +256,7 @@ class TestSlapOSWebSection_getEventList(TestRSSSyleSkinsMixin):
'{}-{}'.format(event.getFollowUp(), '{}-{}'.format(event.getFollowUp(),
event.getRelativeUrl())) event.getRelativeUrl()))
self.assertEqual(open_ticket_list[0].title, self.assertEqual(open_ticket_list[0].title,
ticket.getTitle()) '[MONITORING] %s' % ticket.getTitle())
self.assertIn("%s/#/" % web_site.absolute_url(), self.assertIn("%s/#/" % web_site.absolute_url(),
open_ticket_list[0].link) open_ticket_list[0].link)
...@@ -312,14 +322,14 @@ class TestSlapOSWebSection_getEventList(TestRSSSyleSkinsMixin): ...@@ -312,14 +322,14 @@ class TestSlapOSWebSection_getEventList(TestRSSSyleSkinsMixin):
'{}-{}'.format(event_rr.getFollowUp(), '{}-{}'.format(event_rr.getFollowUp(),
event_rr.getRelativeUrl())) event_rr.getRelativeUrl()))
self.assertEqual(open_ticket_list[0].title, self.assertEqual(open_ticket_list[0].title,
regularisation_request.getTitle()) '[ACKNOWLEDGEMENT] %s' % regularisation_request.getTitle())
self.assertIn("%s/#/" % web_site.absolute_url(), self.assertIn("%s/#/" % web_site.absolute_url(),
open_ticket_list[0].link) open_ticket_list[0].link)
# Now add one Upgrade Decision # Now add one Upgrade Decision
self.login() self.login()
sleep(2) sleep(2)
upgrade_decision = self.newUpgradeDecision(person, None, None) upgrade_decision = self.newUpgradeDecision(person, project, None)
self.login(person.getUserId()) self.login(person.getUserId())
event_ud = upgrade_decision.getFollowUpRelatedValue() event_ud = upgrade_decision.getFollowUpRelatedValue()
...@@ -399,19 +409,19 @@ class TestSlapOSWebSection_getEventList(TestRSSSyleSkinsMixin): ...@@ -399,19 +409,19 @@ class TestSlapOSWebSection_getEventList(TestRSSSyleSkinsMixin):
# check if ordering is correct. # check if ordering is correct.
self.assertEqual(open_ticket_list[0].title, self.assertEqual(open_ticket_list[0].title,
upgrade_decision.getTitle()) '[THEIA IDE] %s' % upgrade_decision.getTitle())
self.assertIn("%s/#/" % web_site.absolute_url(), self.assertIn("%s/#/" % web_site.absolute_url(),
open_ticket_list[1].link) open_ticket_list[1].link)
self.assertEqual(open_ticket_list[1].title, self.assertEqual(open_ticket_list[1].title,
regularisation_request.getTitle()) '[ACKNOWLEDGEMENT] %s' % regularisation_request.getTitle())
self.assertIn("%s/#/" % web_site.absolute_url(), self.assertIn("%s/#/" % web_site.absolute_url(),
open_ticket_list[1].link) open_ticket_list[1].link)
self.assertEqual(open_ticket_list[2].title, self.assertEqual(open_ticket_list[2].title,
ticket.getTitle()) '[MONITORING] %s' % ticket.getTitle())
self.assertIn("%s/#/" % web_site.absolute_url(), self.assertIn("%s/#/" % web_site.absolute_url(),
open_ticket_list[2].link) open_ticket_list[2].link)
......
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