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
Klaus Wölfel
slapos.core
Commits
350adff0
Commit
350adff0
authored
Nov 14, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cover basic simulation for Hosting Subscription.
parent
3405330a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
1 deletion
+45
-1
master/bt5/slapos_erp5/TestTemplateItem/testSlapOSERP5DefaultScenario.py
...os_erp5/TestTemplateItem/testSlapOSERP5DefaultScenario.py
+44
-0
master/bt5/slapos_erp5/bt/revision
master/bt5/slapos_erp5/bt/revision
+1
-1
No files found.
master/bt5/slapos_erp5/TestTemplateItem/testSlapOSERP5DefaultScenario.py
View file @
350adff0
...
@@ -369,6 +369,35 @@ class TestSlapOSDefaultScenario(TestSlapOSSecurityMixin):
...
@@ -369,6 +369,35 @@ class TestSlapOSDefaultScenario(TestSlapOSSecurityMixin):
partition
.
contentValues
(
portal_type
=
'Internet Protocol Address'
)],
partition
.
contentValues
(
portal_type
=
'Internet Protocol Address'
)],
connection_dict
.
values
())
connection_dict
.
values
())
def
assertHostingSubscriptionSimulationCoverage
(
self
,
subscription
,
level
=
1
):
self
.
login
()
applied_rule_list
=
self
.
portal
.
portal_catalog
(
portal_type
=
'Applied Rule'
,
causality_uid
=
subscription
.
getUid
())
self
.
assertEqual
(
1
,
len
(
applied_rule_list
))
applied_rule
=
applied_rule_list
[
0
]
simulation_movement_list
=
applied_rule
.
contentValues
(
portal_type
=
'Simulation Movement'
)
self
.
assertNotEqual
(
0
,
len
(
simulation_movement_list
))
open_sale_order_line_template
=
self
.
portal
.
restrictedTraverse
(
self
.
portal
.
portal_preferences
.
getPreferredOpenSaleOrderLineTemplate
())
for
simulation_movement
in
simulation_movement_list
:
self
.
assertEqual
(
open_sale_order_line_template
.
getResource
(),
simulation_movement
.
getResource
())
self
.
assertEqual
(
subscription
.
getRelativeUrl
(),
simulation_movement
.
getAggregate
())
self
.
assertEqual
(
subscription
.
getPeriodicityMonthDay
(),
simulation_movement
.
getStartDate
().
day
())
self
.
assertEqual
(
subscription
.
getPeriodicityMonthDay
(),
simulation_movement
.
getStopDate
().
day
())
applied_rule_list_l2
=
simulation_movement
.
contentValues
(
portal_type
=
'Applied Rule'
)
if
level
==
1
:
self
.
assertEqual
(
0
,
len
(
applied_rule_list_l2
))
else
:
raise
NotImplementedError
def
assertOpenSaleOrderCoverage
(
self
,
person_reference
):
def
assertOpenSaleOrderCoverage
(
self
,
person_reference
):
self
.
login
()
self
.
login
()
person
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Person'
,
person
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Person'
,
...
@@ -527,3 +556,18 @@ class TestSlapOSDefaultScenario(TestSlapOSSecurityMixin):
...
@@ -527,3 +556,18 @@ class TestSlapOSDefaultScenario(TestSlapOSSecurityMixin):
self
.
assertOpenSaleOrderCoverage
(
owner_reference
)
self
.
assertOpenSaleOrderCoverage
(
owner_reference
)
self
.
assertOpenSaleOrderCoverage
(
friend_reference
)
self
.
assertOpenSaleOrderCoverage
(
friend_reference
)
self
.
assertOpenSaleOrderCoverage
(
public_reference
)
self
.
assertOpenSaleOrderCoverage
(
public_reference
)
# check the Subscription Simulation
self
.
stepCallUpdateOpenOrderSimulationAlarm
()
self
.
tic
()
for
person_reference
in
(
owner_reference
,
friend_reference
,
public_reference
):
person
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Person'
,
reference
=
person_reference
)
for
subscription
in
self
.
portal
.
portal_catalog
(
portal_type
=
'Hosting Subscription'
,
default_destination_section_uid
=
person
.
getUid
()):
self
.
assertHostingSubscriptionSimulationCoverage
(
subscription
.
getObject
())
master/bt5/slapos_erp5/bt/revision
View file @
350adff0
88
89
\ No newline at end of file
\ No newline at end of file
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