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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos.core
Commits
3dda255e
Commit
3dda255e
authored
Jul 31, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fetch directly monthly invoice.
parent
84e61d95
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
27 deletions
+22
-27
master/product/Vifib/tests/testVifibDefaultUseCase.py
master/product/Vifib/tests/testVifibDefaultUseCase.py
+22
-27
No files found.
master/product/Vifib/tests/testVifibDefaultUseCase.py
View file @
3dda255e
...
...
@@ -15,6 +15,25 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
return
transaction_list
[
0
].
getObject
().
getParentValue
()
def
_getMonthlyInvoice
(
self
,
person
):
line_list
=
self
.
portal
.
portal_catalog
(
resource_relative_url
=
[
self
.
portal
.
portal_preferences
.
getPreferredInstanceSetupResource
(),
self
.
portal
.
portal_preferences
.
getPreferredInstanceHostingResource
(),
self
.
portal
.
portal_preferences
.
getPreferredInstanceCleanupResource
(),
self
.
portal
.
portal_preferences
.
getPreferredInstanceUpdateResource
(),
self
.
portal
.
portal_preferences
.
getPreferredInstanceSubscriptionResource
(),
],
portal_type
=
"Invoice Line"
,
**
{
'movement.destination_uid'
:
person
.
getUid
()}
)
transaction_list
=
[
line
.
getParentValue
()
for
line
in
line_list
]
transaction_list
=
list
(
set
(
transaction_list
))
self
.
assertEquals
(
1
,
len
(
transaction_list
))
return
transaction_list
[
0
].
getObject
().
getParentValue
()
def
stepCheckRegistrationAccounting
(
self
,
sequence
,
**
kw
):
"""
"""
...
...
@@ -601,15 +620,7 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
person
=
self
.
portal
.
ERP5Site_getAuthenticatedMemberPersonValue
(
sequence
[
'web_user'
])
# Check that 2 sale invoice has been generated for the user
transaction_list
=
self
.
portal
.
portal_catalog
(
portal_type
=
"Sale Invoice Transaction"
,
destination_section_relative_url
=
person
.
getRelativeUrl
(),
sort_on
=
((
'creation_date'
,
'DESC'
),),
)
self
.
assertEquals
(
2
,
len
(
transaction_list
))
sale_invoice
=
transaction_list
[
0
].
getObject
()
sale_invoice
=
self
.
_getMonthlyInvoice
(
person
)
# Check invoice creation
self
.
assertEquals
(
...
...
@@ -779,15 +790,7 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
person
=
self
.
portal
.
ERP5Site_getAuthenticatedMemberPersonValue
(
sequence
[
'web_user'
])
# Check that 2 sale invoice has been generated for the user
transaction_list
=
self
.
portal
.
portal_catalog
(
portal_type
=
"Sale Invoice Transaction"
,
destination_section_relative_url
=
person
.
getRelativeUrl
(),
sort_on
=
((
'creation_date'
,
'DESC'
),),
)
self
.
assertEquals
(
2
,
len
(
transaction_list
))
sale_invoice
=
transaction_list
[
0
].
getObject
()
sale_invoice
=
self
.
_getMonthlyInvoice
(
person
)
# Check invoice creation
self
.
assertEquals
(
...
...
@@ -1094,15 +1097,7 @@ class TestVifibDefaultUseCase(TestVifibSlapWebServiceMixin):
person
=
self
.
portal
.
ERP5Site_getAuthenticatedMemberPersonValue
(
sequence
[
'web_user'
])
# Check that 2 sale invoice has been generated for the user
transaction_list
=
self
.
portal
.
portal_catalog
(
portal_type
=
"Sale Invoice Transaction"
,
destination_section_relative_url
=
person
.
getRelativeUrl
(),
sort_on
=
((
'creation_date'
,
'DESC'
),),
)
self
.
assertEquals
(
2
,
len
(
transaction_list
))
sale_invoice
=
transaction_list
[
0
].
getObject
()
sale_invoice
=
self
.
_getMonthlyInvoice
(
person
)
# Check invoice creation
self
.
assertEquals
(
...
...
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