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
Hardik Juneja
slapos.core
Commits
f96ab085
Commit
f96ab085
authored
Dec 28, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Follow reality: Invoice are stopped.
parent
cf404d2b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
13 deletions
+18
-13
master/product/Vifib/tests/testVifibInstanceHostingRelatedDocument.py
...ct/Vifib/tests/testVifibInstanceHostingRelatedDocument.py
+18
-13
No files found.
master/product/Vifib/tests/testVifibInstanceHostingRelatedDocument.py
View file @
f96ab085
...
...
@@ -370,7 +370,11 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
self
.
portal
.
portal_catalog
.
getResultValue
(
uid
=
sequence
[
'invoice_uid'
]).
start
()
def
stepCheckHostingSubscriptionStartedInvoiceDocumentCoverage
(
self
,
def
stepStopInvoice
(
self
,
sequence
,
**
kw
):
self
.
portal
.
portal_catalog
.
getResultValue
(
uid
=
sequence
[
'invoice_uid'
]).
stop
()
def
stepCheckHostingSubscriptionStoppedInvoiceDocumentCoverage
(
self
,
sequence
,
**
kw
):
catalog
=
self
.
portal
.
portal_catalog
hosting_subscription
=
catalog
.
getResultValue
(
...
...
@@ -404,7 +408,7 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
aggregate_relative_url
=
hosting_subscription_url
,
resource_relative_url
=
sequence
[
'setup_resource'
])
self
.
assertEqual
(
1
,
len
(
setup_invoice_line_list
))
self
.
assertEqual
(
'st
art
ed'
,
setup_invoice_line_list
[
0
]
\
self
.
assertEqual
(
'st
opp
ed'
,
setup_invoice_line_list
[
0
]
\
.
getSimulationState
())
# there are 10 confirmed and 2 stopped subscription, so 2 invoice line
...
...
@@ -422,7 +426,7 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
aggregate_relative_url
=
hosting_subscription_url
,
resource_relative_url
=
sequence
[
'subscription_resource'
])
self
.
assertEqual
(
2
,
len
(
subscription_invoice_line_list
))
self
.
assertEqual
([
'planned'
,
'st
art
ed'
],
self
.
assertEqual
([
'planned'
,
'st
opp
ed'
],
sorted
([
q
.
getSimulationState
()
for
q
in
subscription_invoice_line_list
]))
# there are three invoice lines, where two share same invoice
...
...
@@ -431,7 +435,7 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
setup_invoice_line_list
[
0
].
getParentValue
().
getRelativeUrl
(),
[
q
.
getParentValue
().
getRelativeUrl
()
for
q
in
\
subscription_invoice_line_list
\
if
q
.
getSimulationState
()
==
'st
art
ed'
][
0
]
if
q
.
getSimulationState
()
==
'st
opp
ed'
][
0
]
)
self
.
assertNotEqual
(
setup_invoice_line_list
[
0
].
getParentValue
().
getRelativeUrl
(),
...
...
@@ -440,21 +444,21 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
if
q
.
getSimulationState
()
==
'planned'
][
0
]
)
st
art
ed_invoice
=
setup_invoice_line_list
[
0
].
getParentValue
()
st
opp
ed_invoice
=
setup_invoice_line_list
[
0
].
getParentValue
()
planned_invoice
=
[
q
.
getParentValue
()
for
q
in
\
subscription_invoice_line_list
\
if
q
.
getSimulationState
()
==
'planned'
][
0
]
# invoices shall be solved
self
.
assertEqual
(
'solved'
,
planned_invoice
.
getCausalityState
())
self
.
assertEqual
(
'solved'
,
st
art
ed_invoice
.
getCausalityState
())
self
.
assertEqual
(
'solved'
,
st
opp
ed_invoice
.
getCausalityState
())
# there shall be no payment transaction related to planned invoice
self
.
assertEqual
([],
planned_invoice
.
getCausalityRelatedList
(
portal_type
=
'Payment Transaction'
))
# there shall be one payment transaction related to st
art
ed invoice
payment_transaction_list
=
st
art
ed_invoice
.
getCausalityRelatedValueList
(
# there shall be one payment transaction related to st
opp
ed invoice
payment_transaction_list
=
st
opp
ed_invoice
.
getCausalityRelatedValueList
(
portal_type
=
'Payment Transaction'
)
self
.
assertEqual
(
1
,
len
(
payment_transaction_list
))
payment_transaction
=
payment_transaction_list
[
0
]
...
...
@@ -464,20 +468,20 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
self
.
assertEqual
(
'solved'
,
payment_transaction
.
getCausalityState
())
# only this invoice shall be covered by this payment transaction
self
.
assertEqual
(
st
art
ed_invoice
.
getRelativeUrl
(),
self
.
assertEqual
(
st
opp
ed_invoice
.
getRelativeUrl
(),
payment_transaction
.
getCausality
())
# this payment shall fully pay the invoice
self
.
assertEqual
(
st
art
ed_invoice
.
getTotalPrice
(),
self
.
assertEqual
(
st
opp
ed_invoice
.
getTotalPrice
(),
payment_transaction
.
PaymentTransaction_getTotalPayablePrice
())
# St
art
ed invoice shall have causality of two packing lists
# St
opp
ed invoice shall have causality of two packing lists
self
.
assertEqual
(
sorted
([
setup_delivery_line_list
[
0
].
getParentValue
().
getUid
()]
+
[
q
.
getParentValue
().
getUid
()
for
q
in
subscription_delivery_line_list
\
if
q
.
getSimulationState
()
==
'stopped'
and
\
q
.
getParentValue
().
getUid
()
!=
sequence
[
'subscription_delivery_uid'
]]),
sorted
(
st
art
ed_invoice
.
getCausalityUidList
()))
sorted
(
st
opp
ed_invoice
.
getCausalityUidList
()))
# planned invoice shall have causality of one packing list
self
.
assertEqual
(
...
...
@@ -537,12 +541,13 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
# Lets check the payment
StartInvoice
StopInvoice
Tic
TriggerBuild
Tic
CheckHostingSubscriptionSt
art
edInvoiceDocumentCoverage
CheckHostingSubscriptionSt
opp
edInvoiceDocumentCoverage
CheckPaymentStarting
"""
...
...
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