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
6e1e9454
Commit
6e1e9454
authored
Apr 06, 2023
by
Romain Courteaud
🐙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_subscription_request: test slapos_subscription_request_create_from_orphaned_item
parent
12215498
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
5 deletions
+44
-5
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/Alarm_createSubscriptionRequestFromOrphanedItem.py
...equest/Alarm_createSubscriptionRequestFromOrphanedItem.py
+4
-4
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionAlarm.py
...ortal_components/test.erp5.testSlapOSSubscriptionAlarm.py
+40
-1
No files found.
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/Alarm_createSubscriptionRequestFromOrphanedItem.py
View file @
6e1e9454
...
...
@@ -5,14 +5,14 @@ portal = context.getPortalObject()
# TODO find a way to check the portal type
select_dict
=
{
'aggregate__related__uid'
:
None
}
kw
=
{}
kw
[
'select_dict'
]
=
select_dict
kw
[
'left_join_list'
]
=
select_dict
.
keys
()
kw
[
'aggregate__related__uid'
]
=
None
kw
[
'select_dict'
]
=
select_dict
kw
[
'left_join_list'
]
=
select_dict
.
keys
()
kw
.
update
(
select_dict
)
portal
.
portal_catalog
.
searchAndActivate
(
method_id
=
'Item_createSubscriptionRequest'
,
# Project are created only from UI for now
portal_type
=
[
"Instance Tree"
,
"Project"
],
portal_type
=
[
"Instance Tree"
],
activate_kw
=
{
'tag'
:
tag
},
**
kw
)
...
...
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionAlarm.py
View file @
6e1e9454
...
...
@@ -23,4 +23,43 @@ from erp5.component.test.SlapOSTestCaseMixin import \
class
TestSlapOSSubscriptionRequestProcessAlarm
(
SlapOSTestCaseMixin
):
pass
def
test_alarm_slapos_subscription_request_create_from_orphaned_item
(
self
):
script_name
=
"Item_createSubscriptionRequest"
alarm
=
self
.
portal
.
portal_alarms
.
slapos_subscription_request_create_from_orphaned_item
#####################################################
# Instance Tree without Subscription Request
instance_tree
=
self
.
portal
.
instance_tree_module
.
newContent
(
portal_type
=
'Instance Tree'
,
title
=
"Test Instance Tree no subscription %s"
%
self
.
new_id
)
self
.
_test_alarm
(
alarm
,
instance_tree
,
script_name
)
#####################################################
# Instance Tree with Subscription Request
instance_tree
=
self
.
portal
.
instance_tree_module
.
newContent
(
portal_type
=
'Instance Tree'
,
title
=
"Test Instance Tree no subscription %s"
%
self
.
new_id
)
self
.
portal
.
subscription_request_module
.
newContent
(
portal_type
=
'Subscription Request'
,
title
=
"Test Subscription Request %s"
%
self
.
new_id
,
aggregate_value
=
instance_tree
)
self
.
_test_alarm_not_visited
(
alarm
,
instance_tree
,
script_name
)
#####################################################
# Instance Tree aggregated to another portal type
# TODO how to ensure Instance Tree is visited?
instance_tree
=
self
.
portal
.
instance_tree_module
.
newContent
(
portal_type
=
'Instance Tree'
,
title
=
"Test Instance Tree another portal type %s"
%
self
.
new_id
)
self
.
portal
.
sale_packing_list_module
.
newContent
(
portal_type
=
'Sale Packing List'
,
title
=
"Test Sale Packing List %s"
%
self
.
new_id
,
).
newContent
(
portal_type
=
"Sale Packing List Line"
,
aggregate_value
=
instance_tree
)
self
.
_test_alarm_not_visited
(
alarm
,
instance_tree
,
script_name
)
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