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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
8fc637ce
Commit
8fc637ce
authored
Mar 06, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_rss_style: test: factorize
parent
80529b55
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
47 deletions
+29
-47
master/bt5/slapos_rss_style/TestTemplateItem/portal_components/test.erp5.testSlapOSRSSStyleSkins.py
...em/portal_components/test.erp5.testSlapOSRSSStyleSkins.py
+29
-47
No files found.
master/bt5/slapos_rss_style/TestTemplateItem/portal_components/test.erp5.testSlapOSRSSStyleSkins.py
View file @
8fc637ce
...
...
@@ -376,31 +376,35 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin):
self
.
login
(
person
.
getUserId
())
self
.
_test_ticket
(
ticket
,
initial_amount
+
2
)
def
test_upgrade_decision
(
self
):
def
newUpgradeDecision
():
self
.
portal
.
portal_skins
.
changeSkin
(
'View'
)
def
newUpgradeDecision
(
self
,
person
=
None
):
self
.
portal
.
portal_skins
.
changeSkin
(
'View'
)
destination_decision_value
=
None
if
person
is
None
:
person
=
self
.
makePerson
(
self
.
addProject
())
ticket
=
self
.
portal
.
upgrade_decision_module
.
newContent
(
portal_type
=
'Upgrade Decision'
,
title
=
"Upgrade Decision Test %s"
%
self
.
new_id
,
reference
=
"TESTUD-%s"
%
self
.
new_id
)
event
=
self
.
portal
.
event_module
.
newContent
(
portal_type
=
'Web Message'
,
follow_up_value
=
ticket
,
text_content
=
ticket
.
getTitle
(),
start_date
=
DateTime
(),
source_value
=
person
,
#destination_value=self.portal.organisation_module.slapos,
resource_value
=
self
.
portal
.
service_module
.
slapos_crm_monitoring
)
ticket
.
immediateReindexObject
()
event
.
start
()
event
.
immediateReindexObject
()
self
.
portal
.
portal_skins
.
changeSkin
(
'RSS'
)
return
ticket
else
:
destination_decision_value
=
person
ticket
=
self
.
portal
.
upgrade_decision_module
.
newContent
(
portal_type
=
'Upgrade Decision'
,
title
=
"Upgrade Decision Test %s"
%
self
.
new_id
,
reference
=
"TESTUD-%s"
%
self
.
new_id
,
destination_decision_value
=
destination_decision_value
)
event
=
self
.
portal
.
event_module
.
newContent
(
portal_type
=
'Web Message'
,
follow_up_value
=
ticket
,
text_content
=
ticket
.
getTitle
(),
start_date
=
DateTime
(),
source_value
=
person
,
#destination_value=self.portal.organisation_module.slapos,
resource_value
=
self
.
portal
.
service_module
.
slapos_crm_monitoring
)
ticket
.
immediateReindexObject
()
event
.
start
()
event
.
immediateReindexObject
()
self
.
portal
.
portal_skins
.
changeSkin
(
'RSS'
)
return
ticket
def
test_upgrade_decision
(
self
):
person
=
self
.
makePerson
(
self
.
addProject
(),
index
=
1
,
user
=
1
)
person
.
newContent
(
portal_type
=
"Assignment"
,
group
=
"company"
).
open
()
...
...
@@ -413,12 +417,12 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin):
self
.
portal
.
upgrade_decision_module
.
Folder_getOpenTicketList
())
self
.
login
()
ticket
=
newUpgradeDecision
()
ticket
=
self
.
newUpgradeDecision
()
self
.
login
(
person
.
getUserId
())
self
.
_test_upgrade_decision
(
ticket
,
initial_amount
+
1
)
self
.
login
()
ticket
=
newUpgradeDecision
()
ticket
=
self
.
newUpgradeDecision
()
self
.
login
(
person
.
getUserId
())
self
.
_test_upgrade_decision
(
ticket
,
initial_amount
+
2
)
...
...
@@ -888,31 +892,9 @@ class TestSlapOSBase_getEventList(TestRSSSyleSkinsMixin):
regularisation_request
.
getTitle
())
# Now add one Upgrade Decision
def
newUpgradeDecision
(
person
):
self
.
portal
.
portal_skins
.
changeSkin
(
'View'
)
ticket
=
self
.
portal
.
upgrade_decision_module
.
newContent
(
portal_type
=
'Upgrade Decision'
,
title
=
"Upgrade Decision Test %s"
%
self
.
new_id
,
reference
=
"TESTUD-%s"
%
self
.
new_id
,
destination_decision_value
=
person
)
event
=
self
.
portal
.
event_module
.
newContent
(
portal_type
=
'Web Message'
,
follow_up_value
=
ticket
,
text_content
=
ticket
.
getTitle
(),
start_date
=
DateTime
(),
source_value
=
person
,
#destination_value=self.portal.organisation_module.slapos,
resource_value
=
self
.
portal
.
service_module
.
slapos_crm_monitoring
)
ticket
.
immediateReindexObject
()
event
.
start
()
event
.
immediateReindexObject
()
self
.
portal
.
portal_skins
.
changeSkin
(
'RSS'
)
return
ticket
self
.
login
()
upgrade_decision
=
newUpgradeDecision
(
person
)
upgrade_decision
=
self
.
newUpgradeDecision
(
person
)
self
.
login
(
person
.
getUserId
())
event_ud
=
upgrade_decision
.
getFollowUpRelatedValue
()
...
...
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