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
640d8bd5
Commit
640d8bd5
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
f743d85b
Changes
2
Hide 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 @
640d8bd5
...
@@ -5,14 +5,14 @@ portal = context.getPortalObject()
...
@@ -5,14 +5,14 @@ portal = context.getPortalObject()
# TODO find a way to check the portal type
# TODO find a way to check the portal type
select_dict
=
{
'aggregate__related__uid'
:
None
}
select_dict
=
{
'aggregate__related__uid'
:
None
}
kw
=
{}
kw
=
{}
kw
[
'select_dict'
]
=
select_dict
kw
[
'select_dict'
]
=
select_dict
kw
[
'left_join_list'
]
=
select_dict
.
keys
()
kw
[
'left_join_list'
]
=
select_dict
.
keys
()
kw
[
'aggregate__related__uid'
]
=
None
kw
.
update
(
select_dict
)
portal
.
portal_catalog
.
searchAndActivate
(
portal
.
portal_catalog
.
searchAndActivate
(
method_id
=
'Item_createSubscriptionRequest'
,
method_id
=
'Item_createSubscriptionRequest'
,
# Project are created only from UI for now
# Project are created only from UI for now
portal_type
=
[
"Instance Tree"
,
"Project"
],
portal_type
=
[
"Instance Tree"
],
activate_kw
=
{
'tag'
:
tag
},
activate_kw
=
{
'tag'
:
tag
},
**
kw
**
kw
)
)
...
...
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionAlarm.py
View file @
640d8bd5
...
@@ -23,4 +23,43 @@ from erp5.component.test.SlapOSTestCaseMixin import \
...
@@ -23,4 +23,43 @@ from erp5.component.test.SlapOSTestCaseMixin import \
class
TestSlapOSSubscriptionRequestProcessAlarm
(
SlapOSTestCaseMixin
):
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