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
65c779b5
Commit
65c779b5
authored
May 12, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_subscription_request: test that Subscription Request is created from Compute Node
parent
7e3ae743
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
15 deletions
+21
-15
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionAlarm.py
...ortal_components/test.erp5.testSlapOSSubscriptionAlarm.py
+21
-15
No files found.
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionAlarm.py
View file @
65c779b5
...
...
@@ -23,42 +23,48 @@ from erp5.component.test.SlapOSTestCaseMixin import \
class
TestSlapOSSubscriptionRequestProcessAlarm
(
SlapOSTestCaseMixin
):
def
test_alarm_slapos_subscription_request_create_from_orphaned_item
(
self
):
def
_test_alarm_slapos_subscription_request_create_from_orphaned_item
(
self
,
portal_type
):
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
document
=
self
.
portal
.
getDefaultModule
(
portal_type
)
.
newContent
(
portal_type
=
portal_type
,
title
=
"Test
%s no subscription %s"
%
(
portal_type
,
self
.
new_id
)
)
self
.
_test_alarm
(
alarm
,
instance_tree
,
script_name
)
self
.
_test_alarm
(
alarm
,
document
,
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
document
=
self
.
portal
.
getDefaultModule
(
portal_type
)
.
newContent
(
portal_type
=
portal_type
,
title
=
"Test
%s no subscription %s"
%
(
portal_type
,
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
aggregate_value
=
document
)
self
.
_test_alarm_not_visited
(
alarm
,
instance_tree
,
script_name
)
self
.
_test_alarm_not_visited
(
alarm
,
document
,
script_name
)
#####################################################
# Instance Tree aggregated to another portal type
instance_tree
=
self
.
portal
.
instance_tree_module
.
newContent
(
portal_type
=
'Instance Tree'
,
title
=
"Test
Instance Tree another portal type %s"
%
self
.
new_id
document
=
self
.
portal
.
getDefaultModule
(
portal_type
)
.
newContent
(
portal_type
=
portal_type
,
title
=
"Test
%s another portal type %s"
%
(
portal_type
,
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
aggregate_value
=
document
)
self
.
_test_alarm
(
alarm
,
instance_tree
,
script_name
)
self
.
_test_alarm
(
alarm
,
document
,
script_name
)
def
test_alarm_slapos_subscription_request_create_from_orphaned_instance_tree
(
self
):
self
.
_test_alarm_slapos_subscription_request_create_from_orphaned_item
(
"Instance Tree"
)
def
test_alarm_slapos_subscription_request_create_from_orphaned_compute_node
(
self
):
self
.
_test_alarm_slapos_subscription_request_create_from_orphaned_item
(
"Compute Node"
)
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