Commit d9562cba authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_rss_style: Include Subscription Request portal_type on the rss feed

   This allows, in case of error, verbose what to do
parent 8c1acbb6
"""Returns all ticket related events for RSS """
Returns all ticket related events for RSS
""" """
from Products.PythonScripts.standard import Object from Products.PythonScripts.standard import Object
portal = context.getPortalObject() portal = context.getPortalObject()
...@@ -25,7 +26,8 @@ def getTicketInfo(event): ...@@ -25,7 +26,8 @@ def getTicketInfo(event):
return getTicket_memo[follow_up] return getTicket_memo[follow_up]
if follow_up_portal_type is None: if follow_up_portal_type is None:
follow_up_portal_type = ['Support Request', 'Regularisation Request', 'Upgrade Decision'] follow_up_portal_type = ['Support Request', 'Regularisation Request',
'Upgrade Decision', 'Subscription Request']
ticket_simulation_state = [ ticket_simulation_state = [
'validated','submitted', 'suspended', 'invalidated', 'validated','submitted', 'suspended', 'invalidated',
......
return context.Base_getEventList( return context.Base_getEventList(
list_lines=list_lines, list_lines=list_lines,
follow_up_portal_type=['Support Request', 'Upgrade Decision'], follow_up_portal_type=['Support Request', 'Upgrade Decision', 'Subscription Request'],
context_related=True, **kw) context_related=True, **kw)
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>method_name</string> </key> <key> <string>method_name</string> </key>
<value> <string>WebSection_getUserTicketList</string> </value> <value> <string>Base_getTicketRelatedEventList</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -70,7 +70,9 @@ ...@@ -70,7 +70,9 @@
</item> </item>
<item> <item>
<key> <string>default_params</string> </key> <key> <string>default_params</string> </key>
<value> <string></string> </value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>editable_columns</string> </key> <key> <string>editable_columns</string> </key>
...@@ -91,7 +93,7 @@ ...@@ -91,7 +93,7 @@
<item> <item>
<key> <string>lines</string> </key> <key> <string>lines</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -101,7 +103,7 @@ ...@@ -101,7 +103,7 @@
<item> <item>
<key> <string>selection_name</string> </key> <key> <string>selection_name</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -189,7 +191,7 @@ ...@@ -189,7 +191,7 @@
<item> <item>
<key> <string>list_method</string> </key> <key> <string>list_method</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -220,7 +222,7 @@ ...@@ -220,7 +222,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: int(here.REQUEST.get(\'size\', preferences.getPreference(\'preferred_listbox_list_mode_line_count\', 30)))</string> </value> <value> <string>python: [[\'user_restricted\', 1]]</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
...@@ -233,12 +235,25 @@ ...@@ -233,12 +235,25 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python:\'%s_ticket_rss_selection\' % here.getId()</string> </value> <value> <string>python: int(here.REQUEST.get(\'size\', preferences.getPreference(\'preferred_listbox_list_mode_line_count\', 30)))</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="4" aka="AAAAAAAAAAQ="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:\'%s_ticket_rss_selection\' % here.getId()</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle> <pickle>
<global name="Method" module="Products.Formulator.MethodField"/> <global name="Method" module="Products.Formulator.MethodField"/>
</pickle> </pickle>
......
...@@ -70,7 +70,9 @@ ...@@ -70,7 +70,9 @@
</item> </item>
<item> <item>
<key> <string>default_params</string> </key> <key> <string>default_params</string> </key>
<value> <string></string> </value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>editable_columns</string> </key> <key> <string>editable_columns</string> </key>
...@@ -91,7 +93,7 @@ ...@@ -91,7 +93,7 @@
<item> <item>
<key> <string>lines</string> </key> <key> <string>lines</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -101,7 +103,7 @@ ...@@ -101,7 +103,7 @@
<item> <item>
<key> <string>selection_name</string> </key> <key> <string>selection_name</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -189,7 +191,7 @@ ...@@ -189,7 +191,7 @@
<item> <item>
<key> <string>list_method</string> </key> <key> <string>list_method</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -220,7 +222,7 @@ ...@@ -220,7 +222,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: int(here.REQUEST.get(\'size\', preferences.getPreference(\'preferred_listbox_list_mode_line_count\', 30)))</string> </value> <value> <string>python: [[\'user_restricted\', 1]]</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
...@@ -233,12 +235,25 @@ ...@@ -233,12 +235,25 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python:\'%s_ticket_rss_selection\' % here.getId()</string> </value> <value> <string>python: int(here.REQUEST.get(\'size\', preferences.getPreference(\'preferred_listbox_list_mode_line_count\', 30)))</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="4" aka="AAAAAAAAAAQ="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:\'%s_ticket_rss_selection\' % here.getId()</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle> <pickle>
<global name="Method" module="Products.Formulator.MethodField"/> <global name="Method" module="Products.Formulator.MethodField"/>
</pickle> </pickle>
......
...@@ -225,7 +225,7 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin): ...@@ -225,7 +225,7 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin):
module = ticket.getParentValue() module = ticket.getParentValue()
self.portal.portal_skins.changeSkin('RSS') self.portal.portal_skins.changeSkin('RSS')
open_ticket_list = module.Folder_getOpenTicketList() open_ticket_list = module.Folder_getOpenTicketList(list_lines=1000)
self.assertEqual(len(open_ticket_list), expected_amount) self.assertEqual(len(open_ticket_list), expected_amount)
self.assertNotEqual(open_ticket_list[0].pubDate, None) self.assertNotEqual(open_ticket_list[0].pubDate, None)
self.assertEqual(open_ticket_list[0].guid, self.assertEqual(open_ticket_list[0].guid,
...@@ -235,7 +235,7 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin): ...@@ -235,7 +235,7 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin):
ticket.validate() ticket.validate()
self.tic() self.tic()
self.portal.portal_skins.changeSkin('RSS') self.portal.portal_skins.changeSkin('RSS')
open_ticket_list = module.Folder_getOpenTicketList() open_ticket_list = module.Folder_getOpenTicketList(list_lines=1000)
self.assertEqual(len(open_ticket_list), expected_amount) self.assertEqual(len(open_ticket_list), expected_amount)
self.assertNotEqual(open_ticket_list[0].pubDate, None) self.assertNotEqual(open_ticket_list[0].pubDate, None)
self.assertEqual(open_ticket_list[0].guid, self.assertEqual(open_ticket_list[0].guid,
...@@ -245,7 +245,7 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin): ...@@ -245,7 +245,7 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin):
ticket.suspend() ticket.suspend()
self.tic() self.tic()
self.portal.portal_skins.changeSkin('RSS') self.portal.portal_skins.changeSkin('RSS')
open_ticket_list = module.Folder_getOpenTicketList() open_ticket_list = module.Folder_getOpenTicketList(list_lines=1000)
self.assertEqual(len(open_ticket_list), expected_amount) self.assertEqual(len(open_ticket_list), expected_amount)
self.assertNotEqual(open_ticket_list[0].pubDate, None) self.assertNotEqual(open_ticket_list[0].pubDate, None)
self.assertEqual(open_ticket_list[0].guid, self.assertEqual(open_ticket_list[0].guid,
...@@ -255,7 +255,7 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin): ...@@ -255,7 +255,7 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin):
ticket.invalidate() ticket.invalidate()
self.tic() self.tic()
self.portal.portal_skins.changeSkin('RSS') self.portal.portal_skins.changeSkin('RSS')
open_ticket_list = module.Folder_getOpenTicketList() open_ticket_list = module.Folder_getOpenTicketList(list_lines=1000)
self.assertEqual(len(open_ticket_list), expected_amount) self.assertEqual(len(open_ticket_list), expected_amount)
# Extra checks # Extra checks
self.assertNotEqual(open_ticket_list[0].pubDate, None) self.assertNotEqual(open_ticket_list[0].pubDate, None)
...@@ -272,19 +272,19 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin): ...@@ -272,19 +272,19 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin):
self.assertNotEqual(event, None) self.assertNotEqual(event, None)
module = ticket.getParentValue() module = ticket.getParentValue()
self.portal.portal_skins.changeSkin('RSS') self.portal.portal_skins.changeSkin('RSS')
open_ticket_list = module.Folder_getOpenTicketList() open_ticket_list = module.Folder_getOpenTicketList(list_lines=1000)
self.assertEqual(len(open_ticket_list), expected_amount-1) self.assertEqual(len(open_ticket_list), expected_amount-1)
ticket.plan() ticket.plan()
self.tic() self.tic()
self.portal.portal_skins.changeSkin('RSS') self.portal.portal_skins.changeSkin('RSS')
open_ticket_list = module.Folder_getOpenTicketList() open_ticket_list = module.Folder_getOpenTicketList(list_lines=1000)
self.assertEqual(len(open_ticket_list), expected_amount-1) self.assertEqual(len(open_ticket_list), expected_amount-1)
ticket.confirm() ticket.confirm()
self.tic() self.tic()
self.portal.portal_skins.changeSkin('RSS') self.portal.portal_skins.changeSkin('RSS')
open_ticket_list = module.Folder_getOpenTicketList() open_ticket_list = module.Folder_getOpenTicketList(list_lines=1000)
self.assertEqual(len(open_ticket_list), expected_amount) self.assertEqual(len(open_ticket_list), expected_amount)
self.assertNotEqual(open_ticket_list[0].pubDate, None) self.assertNotEqual(open_ticket_list[0].pubDate, None)
...@@ -301,7 +301,7 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin): ...@@ -301,7 +301,7 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin):
self.login(ticket.getDestinationDecisionValue().getUserId()) self.login(ticket.getDestinationDecisionValue().getUserId())
self.portal.portal_skins.changeSkin('RSS') self.portal.portal_skins.changeSkin('RSS')
open_ticket_list = module.Folder_getOpenTicketList() open_ticket_list = module.Folder_getOpenTicketList(list_lines=1000)
self.assertEqual(len(open_ticket_list), expected_amount) self.assertEqual(len(open_ticket_list), expected_amount)
self.assertNotEqual(open_ticket_list[0].pubDate, None) self.assertNotEqual(open_ticket_list[0].pubDate, None)
self.assertEqual(open_ticket_list[0].guid, self.assertEqual(open_ticket_list[0].guid,
...@@ -311,7 +311,7 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin): ...@@ -311,7 +311,7 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin):
ticket.stop() ticket.stop()
self.tic() self.tic()
self.portal.portal_skins.changeSkin('RSS') self.portal.portal_skins.changeSkin('RSS')
open_ticket_list = module.Folder_getOpenTicketList() open_ticket_list = module.Folder_getOpenTicketList(list_lines=1000)
self.assertEqual(len(open_ticket_list), expected_amount) self.assertEqual(len(open_ticket_list), expected_amount)
self.assertNotEqual(open_ticket_list[0].pubDate, None) self.assertNotEqual(open_ticket_list[0].pubDate, None)
self.assertEqual(open_ticket_list[0].guid, self.assertEqual(open_ticket_list[0].guid,
...@@ -321,7 +321,7 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin): ...@@ -321,7 +321,7 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin):
ticket.deliver() ticket.deliver()
self.tic() self.tic()
self.portal.portal_skins.changeSkin('RSS') self.portal.portal_skins.changeSkin('RSS')
open_ticket_list = module.Folder_getOpenTicketList() open_ticket_list = module.Folder_getOpenTicketList(list_lines=1000)
self.assertEqual(len(open_ticket_list), expected_amount) self.assertEqual(len(open_ticket_list), expected_amount)
self.assertNotEqual(open_ticket_list[0].pubDate, None) self.assertNotEqual(open_ticket_list[0].pubDate, None)
self.assertEqual(open_ticket_list[0].guid, self.assertEqual(open_ticket_list[0].guid,
...@@ -340,7 +340,7 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin): ...@@ -340,7 +340,7 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin):
self.login(person.getUserId()) self.login(person.getUserId())
initial_amount = len( initial_amount = len(
self.portal.support_request_module.Folder_getOpenTicketList()) self.portal.support_request_module.Folder_getOpenTicketList(list_lines=1000))
self.login() self.login()
ticket = self.newSupportRequest(customer, instance_tree) ticket = self.newSupportRequest(customer, instance_tree)
...@@ -364,7 +364,7 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin): ...@@ -364,7 +364,7 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin):
self.login(person.getUserId()) self.login(person.getUserId())
initial_amount = len( initial_amount = len(
self.portal.regularisation_request_module.Folder_getOpenTicketList()) self.portal.regularisation_request_module.Folder_getOpenTicketList(list_lines=1000))
self.login() self.login()
ticket = self.newRegularisationRequest(customer) ticket = self.newRegularisationRequest(customer)
...@@ -390,7 +390,7 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin): ...@@ -390,7 +390,7 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin):
self.login(person.getUserId()) self.login(person.getUserId())
initial_amount = len( initial_amount = len(
self.portal.upgrade_decision_module.Folder_getOpenTicketList()) self.portal.upgrade_decision_module.Folder_getOpenTicketList(list_lines=1000))
self.login() self.login()
ticket = self.newUpgradeDecision(person2, project, None) ticket = self.newUpgradeDecision(person2, project, None)
...@@ -629,6 +629,13 @@ class TestSlapOSBase_getTicketRelatedEventList(TestRSSSyleSkinsMixin): ...@@ -629,6 +629,13 @@ class TestSlapOSBase_getTicketRelatedEventList(TestRSSSyleSkinsMixin):
class TestSlapOSBase_getEventList(TestRSSSyleSkinsMixin): class TestSlapOSBase_getEventList(TestRSSSyleSkinsMixin):
def assertTicketAndEvent(self, open_ticket_list, event, amount):
self.assertEqual(len(open_ticket_list), amount)
self.assertNotEqual(open_ticket_list[0].pubDate, None)
self.assertEqual(open_ticket_list[0].guid,
'{}-{}'.format(event.getFollowUp(),
event.getRelativeUrl()))
def test_Base_getEventList(self): def test_Base_getEventList(self):
# Base_getEventList is already widely tested on Base_getTicketRelatedEventList # Base_getEventList is already widely tested on Base_getTicketRelatedEventList
# and Folder_getOpenTicketList, so we only tested the specific use case of # and Folder_getOpenTicketList, so we only tested the specific use case of
...@@ -649,12 +656,9 @@ class TestSlapOSBase_getEventList(TestRSSSyleSkinsMixin): ...@@ -649,12 +656,9 @@ class TestSlapOSBase_getEventList(TestRSSSyleSkinsMixin):
self.assertNotEqual(event, None) self.assertNotEqual(event, None)
self.portal.portal_skins.changeSkin('RSS') self.portal.portal_skins.changeSkin('RSS')
open_ticket_list = self.portal.Base_getEventList() self.assertTicketAndEvent(self.portal.Base_getEventList(), event, 1)
self.assertEqual(len(open_ticket_list), 1) self.assertTicketAndEvent(self.portal.Base_getEventList(
self.assertNotEqual(open_ticket_list[0].pubDate, None) user_restricted=1), event, 1)
self.assertEqual(open_ticket_list[0].guid,
'{}-{}'.format(event.getFollowUp(),
event.getRelativeUrl()))
self.login() self.login()
ticket.validate() ticket.validate()
...@@ -662,12 +666,9 @@ class TestSlapOSBase_getEventList(TestRSSSyleSkinsMixin): ...@@ -662,12 +666,9 @@ class TestSlapOSBase_getEventList(TestRSSSyleSkinsMixin):
self.login(person.getUserId()) self.login(person.getUserId())
self.portal.portal_skins.changeSkin('RSS') self.portal.portal_skins.changeSkin('RSS')
open_ticket_list = self.portal.Base_getEventList() self.assertTicketAndEvent(self.portal.Base_getEventList(), event, 1)
self.assertEqual(len(open_ticket_list), 1) self.assertTicketAndEvent(self.portal.Base_getEventList(
self.assertNotEqual(open_ticket_list[0].pubDate, None) user_restricted=1), event, 1)
self.assertEqual(open_ticket_list[0].guid,
'{}-{}'.format(event.getFollowUp(),
event.getRelativeUrl()))
self.login() self.login()
ticket.suspend() ticket.suspend()
...@@ -675,12 +676,9 @@ class TestSlapOSBase_getEventList(TestRSSSyleSkinsMixin): ...@@ -675,12 +676,9 @@ class TestSlapOSBase_getEventList(TestRSSSyleSkinsMixin):
self.login(person.getUserId()) self.login(person.getUserId())
self.portal.portal_skins.changeSkin('RSS') self.portal.portal_skins.changeSkin('RSS')
open_ticket_list = self.portal.Base_getEventList() self.assertTicketAndEvent(self.portal.Base_getEventList(), event, 1)
self.assertEqual(len(open_ticket_list), 1) self.assertTicketAndEvent(self.portal.Base_getEventList(
self.assertNotEqual(open_ticket_list[0].pubDate, None) user_restricted=1), event, 1)
self.assertEqual(open_ticket_list[0].guid,
'{}-{}'.format(event.getFollowUp(),
event.getRelativeUrl()))
self.login() self.login()
ticket.invalidate() ticket.invalidate()
...@@ -711,12 +709,14 @@ class TestSlapOSBase_getEventList(TestRSSSyleSkinsMixin): ...@@ -711,12 +709,14 @@ class TestSlapOSBase_getEventList(TestRSSSyleSkinsMixin):
self.portal.portal_skins.changeSkin('RSS') self.portal.portal_skins.changeSkin('RSS')
open_ticket_list = self.portal.Base_getEventList() open_ticket_list = self.portal.Base_getEventList()
self.assertEqual(len(open_ticket_list), 2) self.assertTicketAndEvent(open_ticket_list, event_rr, 2)
self.assertNotEqual(open_ticket_list[0].pubDate, None) # check if previous still the same
self.assertEqual(open_ticket_list[0].guid, self.assertEqual(open_ticket_list[1].guid,
'{}-{}'.format(event_rr.getFollowUp(), '{}-{}'.format(event.getFollowUp(),
event_rr.getRelativeUrl())) event.getRelativeUrl()))
open_ticket_list = self.portal.Base_getEventList(user_restricted=1)
self.assertTicketAndEvent(open_ticket_list, event_rr, 2)
# check if previous still the same # check if previous still the same
self.assertEqual(open_ticket_list[1].guid, self.assertEqual(open_ticket_list[1].guid,
'{}-{}'.format(event.getFollowUp(), '{}-{}'.format(event.getFollowUp(),
...@@ -728,12 +728,9 @@ class TestSlapOSBase_getEventList(TestRSSSyleSkinsMixin): ...@@ -728,12 +728,9 @@ class TestSlapOSBase_getEventList(TestRSSSyleSkinsMixin):
self.login(person.getUserId()) self.login(person.getUserId())
self.portal.portal_skins.changeSkin('RSS') self.portal.portal_skins.changeSkin('RSS')
open_ticket_list = self.portal.Base_getEventList() self.assertTicketAndEvent(self.portal.Base_getEventList(), event_rr, 2)
self.assertEqual(len(open_ticket_list), 2) self.assertTicketAndEvent(
self.assertNotEqual(open_ticket_list[0].pubDate, None) self.portal.Base_getEventList(user_restricted=1), event_rr, 2)
self.assertEqual(open_ticket_list[0].guid,
'{}-{}'.format(event_rr.getFollowUp(),
event_rr.getRelativeUrl()))
self.login() self.login()
regularisation_request.suspend() regularisation_request.suspend()
...@@ -741,12 +738,9 @@ class TestSlapOSBase_getEventList(TestRSSSyleSkinsMixin): ...@@ -741,12 +738,9 @@ class TestSlapOSBase_getEventList(TestRSSSyleSkinsMixin):
self.login(person.getUserId()) self.login(person.getUserId())
self.portal.portal_skins.changeSkin('RSS') self.portal.portal_skins.changeSkin('RSS')
open_ticket_list = self.portal.Base_getEventList() self.assertTicketAndEvent(self.portal.Base_getEventList(), event_rr, 2)
self.assertEqual(len(open_ticket_list), 2) self.assertTicketAndEvent(
self.assertNotEqual(open_ticket_list[0].pubDate, None) self.portal.Base_getEventList(user_restricted=1), event_rr, 2)
self.assertEqual(open_ticket_list[0].guid,
'{}-{}'.format(event_rr.getFollowUp(),
event_rr.getRelativeUrl()))
self.login() self.login()
regularisation_request.invalidate() regularisation_request.invalidate()
...@@ -767,7 +761,6 @@ class TestSlapOSBase_getEventList(TestRSSSyleSkinsMixin): ...@@ -767,7 +761,6 @@ class TestSlapOSBase_getEventList(TestRSSSyleSkinsMixin):
regularisation_request.getTitle()) regularisation_request.getTitle())
# 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, None, None)
...@@ -852,6 +845,8 @@ class TestSlapOSBase_getEventList(TestRSSSyleSkinsMixin): ...@@ -852,6 +845,8 @@ class TestSlapOSBase_getEventList(TestRSSSyleSkinsMixin):
self.assertEqual(open_ticket_list[2].title, self.assertEqual(open_ticket_list[2].title,
ticket.getTitle()) ticket.getTitle())
class TestBase_getTicketUrl(TestRSSSyleSkinsMixin): class TestBase_getTicketUrl(TestRSSSyleSkinsMixin):
def test_Base_getTicketUrl(self): def test_Base_getTicketUrl(self):
ticket = self.portal.support_request_module.newContent(\ ticket = self.portal.support_request_module.newContent(\
...@@ -912,5 +907,3 @@ class TestSlapOSSaleInvoiceTransaction_getRSSTitleAndDescription(TestRSSSyleSkin ...@@ -912,5 +907,3 @@ class TestSlapOSSaleInvoiceTransaction_getRSSTitleAndDescription(TestRSSSyleSkin
self.assertEqual( self.assertEqual(
invoice_via_website.SaleInvoiceTransaction_getRSSTitle(), invoice_via_website.SaleInvoiceTransaction_getRSSTitle(),
"[SlapOS Master Panel] %s %s - (01/02/2018)" % (text, invoice.getReference())) "[SlapOS Master Panel] %s %s - (01/02/2018)" % (text, invoice.getReference()))
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