Commit 45a23b27 authored by Jérome Perrin's avatar Jérome Perrin

officejs_support_request_ui: Tolerate Events with non visible attachments in RSS

parent 9d147ce2
Pipeline #5612 failed with stage
in 0 seconds
...@@ -58,7 +58,7 @@ for brain in portal.portal_simulation.getMovementHistoryList( ...@@ -58,7 +58,7 @@ for brain in portal.portal_simulation.getMovementHistoryList(
'thumbnail': ( # XXX this is not really a thumbnail, but it's what RSS style uses for <enclosure/> 'thumbnail': ( # XXX this is not really a thumbnail, but it's what RSS style uses for <enclosure/>
# Also, with this `thumbnail` it will look good for image, and most of the time # Also, with this `thumbnail` it will look good for image, and most of the time
# users attach a screenshot of their problem. # users attach a screenshot of their problem.
event.getDefaultAggregate(portal_type=document_type_list) event.getDefaultAggregate(portal_type=document_type_list, checked_permission="View")
and event.getDefaultAggregateValue(portal_type=document_type_list).File_getDownloadUrl() and event.getDefaultAggregateValue(portal_type=document_type_list).File_getDownloadUrl()
or None) or None)
} }
......
...@@ -548,6 +548,25 @@ class TestSupportRequestRSSSNonVisibleSupportRequest(SupportRequestRSSTestCase, ...@@ -548,6 +548,25 @@ class TestSupportRequestRSSSNonVisibleSupportRequest(SupportRequestRSSTestCase,
self.assertFalse(rss.bozo) self.assertFalse(rss.bozo)
class TestSupportRequestRSSSNonVisibleAttachment(SupportRequestRSSTestCase, DefaultTestRSSMixin):
"""Edge case test for support request RSS for an event (visible by user) with attachment not visible by user.
"""
def afterSetUp(self):
super(TestSupportRequestRSSSNonVisibleAttachment, self).afterSetUp()
self.attached_document.manage_permission('View', ['Manager'], 0)
self.attached_document.reindexObject()
self.tic()
def _checkRSS(self, response):
self.assertEqual(httplib.OK, response.getStatus())
rss = feedparser.parse(response.getBody())
item, = rss.entries
# no enclosure
self.assertEqual([], [link for link in item['links'] if link['rel'] == 'enclosure'])
# https://pythonhosted.org/feedparser/bozo.html#advanced-bozo
self.assertFalse(rss.bozo)
class TestIngestPostAsWebMessage(SupportRequestTestCase): class TestIngestPostAsWebMessage(SupportRequestTestCase):
"""Tests ingesting HTML Post into web messages. """Tests ingesting HTML Post into web messages.
""" """
......
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