Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
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
Titouan Soulard
slapos.core
Commits
a425deb7
Commit
a425deb7
authored
Mar 06, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_rss_style: test: use dedicated scripts to create Ticket/Event
parent
df5379d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
59 deletions
+42
-59
master/bt5/slapos_rss_style/SkinTemplateItem/portal_skins/slapos_rss_style/Base_getEventList.py
...teItem/portal_skins/slapos_rss_style/Base_getEventList.py
+0
-1
master/bt5/slapos_rss_style/TestTemplateItem/portal_components/test.erp5.testSlapOSRSSStyleSkins.py
...em/portal_components/test.erp5.testSlapOSRSSStyleSkins.py
+42
-58
No files found.
master/bt5/slapos_rss_style/SkinTemplateItem/portal_skins/slapos_rss_style/Base_getEventList.py
View file @
a425deb7
...
...
@@ -41,7 +41,6 @@ for brain in portal.portal_simulation.getMovementHistoryList(
'confirmed'
,
'started'
,
'stopped'
,
'delivered'
],
only_accountable
=
False
,
follow_up__portal_type
=
follow_up_portal_type
,
omit_input
=
True
,
simulation_state
=
(
'started'
,
'stopped'
,
'delivered'
),
limit
=
list_lines
,
sort_on
=
((
'stock.date'
,
'desc'
),
...
...
master/bt5/slapos_rss_style/TestTemplateItem/portal_components/test.erp5.testSlapOSRSSStyleSkins.py
View file @
a425deb7
...
...
@@ -161,49 +161,40 @@ class TestSlapOSSupportRequestRSS(TestRSSSyleSkinsMixin):
def
test_WebSection_viewTicketListAsRSS
(
self
):
person
=
self
.
makePerson
(
self
.
addProject
())
module
=
self
.
portal
.
support_request_module
support_request
=
module
.
newContent
(
portal_type
=
"Support Request"
,
title
=
'Help'
,
destination_decision_value
=
person
,
support_request
=
person
.
Entity_createTicketFromTradeCondition
(
'service_module/slapos_crm_monitoring'
,
'Help'
,
'I need help !'
,
)
support_request
.
Ticket_createProjectEvent
(
support_request
.
getTitle
(),
'incoming'
,
'Web Message'
,
support_request
.
getResource
(),
text_content
=
support_request
.
getDescription
(),
content_type
=
'text/plain'
,
source
=
person
.
getRelativeUrl
()
)
self
.
portal
.
event_module
.
newContent
(
portal_type
=
'Web Message'
,
follow_up_value
=
support_request
,
text_content
=
'I need help !'
,
start_date
=
DateTime
(),
source_value
=
person
,
#destination_value=self.portal.organisation_module.slapos,
resource_value
=
self
.
portal
.
service_module
.
slapos_crm_monitoring
).
start
()
support_request
.
validate
()
self
.
clearCache
()
self
.
tic
()
self
.
login
(
person
.
getUserId
())
self
.
portal
.
portal_skins
.
changeSkin
(
'RSS'
)
self
.
clearCache
()
transaction
.
commit
()
parsed
=
feedparser
.
parse
(
self
.
portal
.
WebSection_viewTicketListAsRSS
())
self
.
assertFalse
(
parsed
.
bozo
)
first_entry_id
=
[
item
.
id
for
item
in
parsed
.
entries
]
self
.
assertEqual
([
item
.
summary
for
item
in
parsed
.
entries
],
[
'I need help !'
])
self
.
portal
.
event_module
.
newContent
(
portal_type
=
'Web Message'
,
follow_up_value
=
support_request
,
text_content
=
'How can I help you ?'
,
start_date
=
DateTime
(),
destination_value
=
person
,
#source_value=self.portal.organisation_module.slapos,
resource_value
=
self
.
portal
.
service_module
.
slapos_crm_monitoring
).
start
()
self
.
clearCache
()
self
.
logout
()
self
.
login
()
support_request
.
Ticket_createProjectEvent
(
support_request
.
getTitle
(),
'outgoing'
,
'Web Message'
,
support_request
.
getResource
(),
text_content
=
'How can I help you ?'
,
content_type
=
'text/plain'
)
self
.
tic
()
self
.
logout
()
self
.
login
(
person
.
getUserId
())
self
.
portal
.
portal_skins
.
changeSkin
(
'RSS'
)
self
.
clearCache
()
transaction
.
commit
()
parsed
=
feedparser
.
parse
(
self
.
portal
.
WebSection_viewTicketListAsRSS
())
self
.
assertFalse
(
parsed
.
bozo
)
self
.
assertEqual
([
item
.
summary
for
item
in
parsed
.
entries
],
...
...
@@ -213,23 +204,18 @@ class TestSlapOSSupportRequestRSS(TestRSSSyleSkinsMixin):
def
test_WebSection_viewCriticalTicketListAsRSS
(
self
):
person
=
self
.
makePerson
(
self
.
addProject
())
module
=
self
.
portal
.
support_request_module
support_request
=
module
.
newContent
(
portal_type
=
"Support Request"
,
title
=
'Help'
,
destination_decision_value
=
person
,
support_request
=
person
.
Entity_createTicketFromTradeCondition
(
'service_module/slapos_crm_monitoring'
,
'Help'
,
'I need help !'
,
)
support_request
.
Ticket_createProjectEvent
(
support_request
.
getTitle
(),
'incoming'
,
'Web Message'
,
support_request
.
getResource
(),
text_content
=
support_request
.
getDescription
(),
content_type
=
'text/plain'
,
source
=
person
.
getRelativeUrl
()
)
self
.
portal
.
event_module
.
newContent
(
portal_type
=
'Web Message'
,
follow_up_value
=
support_request
,
text_content
=
'I need help !'
,
source_value
=
person
,
start_date
=
DateTime
(),
#destination_value=self.portal.organisation_module.slapos,
resource_value
=
self
.
portal
.
service_module
.
slapos_crm_monitoring
).
start
()
support_request
.
validate
()
self
.
clearCache
()
self
.
tic
()
self
.
login
(
person
.
getUserId
())
...
...
@@ -242,21 +228,19 @@ class TestSlapOSSupportRequestRSS(TestRSSSyleSkinsMixin):
self
.
assertEqual
(
len
(
parsed
.
entries
),
1
)
self
.
assertEqual
([
item
.
summary
for
item
in
parsed
.
entries
],
[
'I need help !'
])
self
.
portal
.
event_module
.
newContent
(
portal_type
=
'Web Message'
,
follow_up_value
=
support_request
,
text_content
=
'How can I help you ?'
,
start_date
=
DateTime
(),
destination_value
=
person
,
#source_value=self.portal.organisation_module.slapos,
resource_value
=
self
.
portal
.
service_module
.
slapos_crm_monitoring
).
start
()
self
.
clearCache
()
self
.
logout
()
self
.
login
()
support_request
.
Ticket_createProjectEvent
(
support_request
.
getTitle
(),
'outgoing'
,
'Web Message'
,
support_request
.
getResource
(),
text_content
=
'How can I help you ?'
,
content_type
=
'text/plain'
)
self
.
tic
()
self
.
logout
()
self
.
login
(
person
.
getUserId
())
self
.
portal
.
portal_skins
.
changeSkin
(
'RSS'
)
self
.
clearCache
()
transaction
.
commit
()
parsed
=
feedparser
.
parse
(
self
.
portal
.
WebSection_viewCriticalTicketListAsRSS
())
self
.
assertFalse
(
parsed
.
bozo
)
self
.
assertEqual
([
item
.
summary
for
item
in
parsed
.
entries
],
...
...
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