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
2e53e3f9
Commit
2e53e3f9
authored
Mar 06, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_rss_style: test: fix one test
parent
f83d9e24
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
16 deletions
+28
-16
master/bt5/slapos_rss_style/TestTemplateItem/portal_components/test.erp5.testSlapOSRSSStyleSkins.py
...em/portal_components/test.erp5.testSlapOSRSSStyleSkins.py
+28
-16
No files found.
master/bt5/slapos_rss_style/TestTemplateItem/portal_components/test.erp5.testSlapOSRSSStyleSkins.py
View file @
2e53e3f9
...
@@ -22,7 +22,8 @@
...
@@ -22,7 +22,8 @@
##############################################################################
##############################################################################
import
transaction
import
transaction
from
erp5.component.test.SlapOSTestCaseMixin
import
SlapOSTestCaseMixinWithAbort
from
erp5.component.test.SlapOSTestCaseMixin
import
SlapOSTestCaseMixinWithAbort
,
TemporaryAlarmScript
from
DateTime
import
DateTime
from
DateTime
import
DateTime
import
feedparser
import
feedparser
...
@@ -242,16 +243,19 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin):
...
@@ -242,16 +243,19 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin):
event
=
ticket
.
getFollowUpRelatedValue
()
event
=
ticket
.
getFollowUpRelatedValue
()
self
.
assertNotEqual
(
event
,
None
)
self
.
assertNotEqual
(
event
,
None
)
module
=
ticket
.
getParentValue
()
module
=
ticket
.
getParentValue
()
self
.
portal
.
portal_skins
.
changeSkin
(
'RSS'
)
open_ticket_list
=
module
.
Folder_getOpenTicketList
()
open_ticket_list
=
module
.
Folder_getOpenTicketList
()
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'
)
open_ticket_list
=
module
.
Folder_getOpenTicketList
()
open_ticket_list
=
module
.
Folder_getOpenTicketList
()
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'
)
open_ticket_list
=
module
.
Folder_getOpenTicketList
()
open_ticket_list
=
module
.
Folder_getOpenTicketList
()
self
.
assertEqual
(
len
(
open_ticket_list
),
expected_amount
)
self
.
assertEqual
(
len
(
open_ticket_list
),
expected_amount
)
...
@@ -261,7 +265,10 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin):
...
@@ -261,7 +265,10 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin):
event
.
getRelativeUrl
()))
event
.
getRelativeUrl
()))
ticket
.
start
()
ticket
.
start
()
with
TemporaryAlarmScript
(
self
.
portal
,
'Base_reindexAndSenseAlarm'
,
"'disabled'"
,
attribute
=
'comment'
):
self
.
tic
()
self
.
tic
()
self
.
portal
.
portal_skins
.
changeSkin
(
'RSS'
)
open_ticket_list
=
module
.
Folder_getOpenTicketList
()
open_ticket_list
=
module
.
Folder_getOpenTicketList
()
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
)
...
@@ -271,6 +278,7 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin):
...
@@ -271,6 +278,7 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin):
ticket
.
stop
()
ticket
.
stop
()
self
.
tic
()
self
.
tic
()
self
.
portal
.
portal_skins
.
changeSkin
(
'RSS'
)
open_ticket_list
=
module
.
Folder_getOpenTicketList
()
open_ticket_list
=
module
.
Folder_getOpenTicketList
()
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
)
...
@@ -280,6 +288,7 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin):
...
@@ -280,6 +288,7 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin):
ticket
.
deliver
()
ticket
.
deliver
()
self
.
tic
()
self
.
tic
()
self
.
portal
.
portal_skins
.
changeSkin
(
'RSS'
)
open_ticket_list
=
module
.
Folder_getOpenTicketList
()
open_ticket_list
=
module
.
Folder_getOpenTicketList
()
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
)
...
@@ -375,35 +384,38 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin):
...
@@ -375,35 +384,38 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin):
self
.
login
(
person
.
getUserId
())
self
.
login
(
person
.
getUserId
())
self
.
_test_ticket
(
ticket
,
initial_amount
+
2
)
self
.
_test_ticket
(
ticket
,
initial_amount
+
2
)
def
newUpgradeDecision
(
self
,
person
=
None
):
def
newUpgradeDecision
(
self
,
person
=
None
,
project
=
None
):
self
.
portal
.
portal_skins
.
changeSkin
(
'View'
)
self
.
portal
.
portal_skins
.
changeSkin
(
'View'
)
destination_decision_value
=
None
destination_decision_value
=
None
if
person
is
None
:
if
person
is
None
:
person
=
self
.
makePerson
(
self
.
addProject
())
destination_decision_value
=
self
.
makePerson
(
self
.
addProject
())
else
:
else
:
destination_decision_value
=
person
destination_decision_value
=
person
ticket
=
self
.
portal
.
upgrade_decision_module
.
newContent
(
ticket
=
self
.
portal
.
upgrade_decision_module
.
newContent
(
portal_type
=
'Upgrade Decision'
,
portal_type
=
'Upgrade Decision'
,
title
=
"Upgrade Decision Test %s"
%
self
.
new_id
,
title
=
"Upgrade Decision Test %s"
%
self
.
new_id
,
reference
=
"TESTUD-%s"
%
self
.
new_id
,
reference
=
"TESTUD-%s"
%
self
.
new_id
,
destination_decision_value
=
destination_decision_value
)
destination_value
=
destination_decision_value
,
destination_decision_value
=
destination_decision_value
,
destination_project_value
=
project
)
event
=
self
.
portal
.
event_module
.
newCont
ent
(
ticket
.
Ticket_createProjectEv
ent
(
portal_type
=
'Web Message'
,
ticket
.
getTitle
(),
'outgoing'
,
'Web Message'
,
follow_up_value
=
ticket
,
'service_module/slapos_crm_monitoring'
,
text_content
=
ticket
.
getTitle
(),
text_content
=
ticket
.
getTitle
(),
start_date
=
DateTime
(),
content_type
=
'text/plain'
source_value
=
person
,
#destination_value=self.portal.organisation_module.slapos,
resource_value
=
self
.
portal
.
service_module
.
slapos_crm_monitoring
)
)
event
.
start
()
self
.
tic
()
self
.
tic
()
self
.
portal
.
portal_skins
.
changeSkin
(
'RSS'
)
self
.
portal
.
portal_skins
.
changeSkin
(
'RSS'
)
return
ticket
return
ticket
def
test_upgrade_decision
(
self
):
def
test_upgrade_decision
(
self
):
person
=
self
.
makePerson
(
self
.
addProject
(),
index
=
1
,
user
=
1
)
project
=
self
.
addProject
()
person
=
self
.
makePerson
(
project
,
index
=
1
,
user
=
1
)
self
.
addProjectProductionManagerAssignment
(
person
,
project
)
person2
=
self
.
makePerson
(
project
,
index
=
1
,
user
=
1
)
self
.
tic
()
self
.
tic
()
self
.
portal
.
portal_skins
.
changeSkin
(
'RSS'
)
self
.
portal
.
portal_skins
.
changeSkin
(
'RSS'
)
...
@@ -413,12 +425,12 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin):
...
@@ -413,12 +425,12 @@ class TestSlapOSFolder_getOpenTicketList(TestRSSSyleSkinsMixin):
self
.
portal
.
upgrade_decision_module
.
Folder_getOpenTicketList
())
self
.
portal
.
upgrade_decision_module
.
Folder_getOpenTicketList
())
self
.
login
()
self
.
login
()
ticket
=
self
.
newUpgradeDecision
()
ticket
=
self
.
newUpgradeDecision
(
person
=
person2
,
project
=
project
)
self
.
login
(
person
.
getUserId
())
self
.
login
(
person
.
getUserId
())
self
.
_test_upgrade_decision
(
ticket
,
initial_amount
+
1
)
self
.
_test_upgrade_decision
(
ticket
,
initial_amount
+
1
)
self
.
login
()
self
.
login
()
ticket
=
self
.
newUpgradeDecision
()
ticket
=
self
.
newUpgradeDecision
(
person
=
person2
,
project
=
project
)
self
.
login
(
person
.
getUserId
())
self
.
login
(
person
.
getUserId
())
self
.
_test_upgrade_decision
(
ticket
,
initial_amount
+
2
)
self
.
_test_upgrade_decision
(
ticket
,
initial_amount
+
2
)
...
...
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