Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
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
Roque
erp5
Commits
9d147ce2
Commit
9d147ce2
authored
Nov 13, 2018
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
officejs_support_request_ui: Tolerate Events with non visible SR in RSS
parent
43c3206b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletion
+28
-1
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/SupportRequestModule_getEventList.py
...cejs_support_request/SupportRequestModule_getEventList.py
+5
-1
bt5/erp5_officejs_support_request_ui_test/TestTemplateItem/portal_components/test.erp5.testSupportRequest.py
...ateItem/portal_components/test.erp5.testSupportRequest.py
+23
-0
No files found.
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/SupportRequestModule_getEventList.py
View file @
9d147ce2
...
...
@@ -16,7 +16,11 @@ def getSupportRequestInfo(event):
try
:
return
getSupportRequest_memo
[
follow_up
]
except
KeyError
:
support_request
=
portal
.
restrictedTraverse
(
follow_up
)
support_request
=
portal
.
restrictedTraverse
(
follow_up
,
None
)
if
support_request
is
None
:
# For corner cases where user has an event for which he cannot access the ticket,
# we don't raise error so that others events are visible.
return
event
.
getTitle
(),
''
,
''
getSupportRequest_memo
[
follow_up
]
=
(
support_request
.
getTitle
(),
support_request
.
getResourceTranslatedTitle
()
or
''
,
...
...
bt5/erp5_officejs_support_request_ui_test/TestTemplateItem/portal_components/test.erp5.testSupportRequest.py
View file @
9d147ce2
...
...
@@ -525,6 +525,29 @@ class TestSupportRequestRSSSMultipleEvents(SupportRequestRSSTestCase, DefaultTes
self
.
assertFalse
(
rss
.
bozo
)
class
TestSupportRequestRSSSNonVisibleSupportRequest
(
SupportRequestRSSTestCase
,
DefaultTestRSSMixin
):
"""Edge case test for support request RSS for an event (visible by user) on a support request not visible by user.
"""
def
afterSetUp
(
self
):
super
(
TestSupportRequestRSSSNonVisibleSupportRequest
,
self
).
afterSetUp
()
support_request
=
self
.
support_request
.
Base_createCloneDocument
(
batch_mode
=
True
)
support_request
.
manage_permission
(
'View'
,
[
'Manager'
],
0
)
self
.
event
.
setFollowUpValue
(
support_request
)
self
.
tic
()
def
_checkRSS
(
self
,
response
):
self
.
assertEqual
(
httplib
.
OK
,
response
.
getStatus
())
rss
=
feedparser
.
parse
(
response
.
getBody
())
item
,
=
rss
.
entries
self
.
assertEqual
(
item
[
'author'
],
self
.
user
.
getTitle
())
# there's no link to support request, as user cannot see it.
self
.
assertNotIn
(
self
.
support_request
.
getRelativeUrl
(),
item
[
'link'
])
self
.
assertEqual
(
item
[
'published'
],
DateTime
(
2001
,
1
,
1
).
rfc822
())
self
.
assertEqual
(
item
[
'summary'
],
'<p>This is <b>Content</b></p>'
)
# https://pythonhosted.org/feedparser/bozo.html#advanced-bozo
self
.
assertFalse
(
rss
.
bozo
)
class
TestIngestPostAsWebMessage
(
SupportRequestTestCase
):
"""Tests ingesting HTML Post into web messages.
"""
...
...
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