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
Léo-Paul Géneau
slapos.core
Commits
45020470
Commit
45020470
authored
Feb 02, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use invoice to represent negative balance.
parent
63648e83
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
42 deletions
+40
-42
master/product/Vifib/tests/testVifibSlapComputerPartitionLock.py
...product/Vifib/tests/testVifibSlapComputerPartitionLock.py
+40
-42
No files found.
master/product/Vifib/tests/testVifibSlapComputerPartitionLock.py
View file @
45020470
...
@@ -234,6 +234,18 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
...
@@ -234,6 +234,18 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
def
stepStartInvoice
(
self
,
sequence
,
**
kw
):
def
stepStartInvoice
(
self
,
sequence
,
**
kw
):
sequence
[
'invoice'
].
start
()
sequence
[
'invoice'
].
start
()
def
stepCheckWebUserBalanceHighAmount
(
self
,
sequence
,
**
kw
):
person
=
self
.
portal
.
ERP5Site_getAuthenticatedMemberPersonValue
(
sequence
[
'web_user'
])
self
.
assertEqual
(
-
10000.0
,
self
.
portal
.
portal_simulation
.
getInventoryAssetPrice
(
node_category
=
'account_type/asset/receivable'
,
simulation_state
=
[
'started'
,
'stopped'
,
'delivered'
],
section_uid
=
self
.
portal
.
restrictedTraverse
(
'organisation_module/vifib_internet'
).
getUid
(),
mirror_section_uid
=
person
.
getUid
())
)
def
stepCheckWebUserBalanceSmallAmount
(
self
,
sequence
,
**
kw
):
def
stepCheckWebUserBalanceSmallAmount
(
self
,
sequence
,
**
kw
):
person
=
self
.
portal
.
ERP5Site_getAuthenticatedMemberPersonValue
(
sequence
[
person
=
self
.
portal
.
ERP5Site_getAuthenticatedMemberPersonValue
(
sequence
[
'web_user'
])
'web_user'
])
...
@@ -352,31 +364,26 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
...
@@ -352,31 +364,26 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
sequence_list
.
play
(
self
)
def
stepCreateHighBalance
NotPaidPayment
(
self
,
sequence
,
**
kw
):
def
stepCreateHighBalance
InvoiceWebUser
(
self
,
sequence
,
**
kw
):
person
=
self
.
portal
.
ERP5Site_getAuthenticatedMemberPersonValue
(
sequence
[
person
=
self
.
portal
.
ERP5Site_getAuthenticatedMemberPersonValue
(
sequence
[
'web_user'
])
'web_user'
])
payment_transaction
=
self
.
portal
.
accounting_module
.
newContent
(
invoice
=
self
.
portal
.
accounting_module
.
newContent
(
source_section
=
'organisation_module/vifib_internet'
,
portal_type
=
'Sale Invoice Transaction'
,
destination_section
=
person
.
getRelativeUrl
(),
start_date
=
DateTime
(),
resource
=
'currency_module/EUR'
,
resource
=
'currency_module/EUR'
,
portal_type
=
"Payment Transaction"
,
source_section
=
'organisation_module/vifib_internet'
,
start_date
=
DateTime
(),
source
=
'organisation_module/vifib_internet'
,
# XXX More info needed
destination_section
=
person
.
getRelativeUrl
(),
)
destination
=
person
.
getRelativeUrl
(),
payment_transaction
.
newContent
(
specialise
=
'sale_trade_condition_module/vifib_trade_condition'
portal_type
=
"Accounting Transaction Line"
,
)
quantity
=
10000
,
invoice
.
newContent
(
source
=
'account_module/receivable'
,
portal_type
=
'Invoice Line'
,
)
resource
=
self
.
portal
.
portal_preferences
.
getPreferredRegistrationResource
(),
payment_transaction
.
newContent
(
quantity
=
1
,
portal_type
=
"Accounting Transaction Line"
,
price
=
10000
quantity
=-
10000
,
)
source
=
'account_module/sales'
,
sequence
[
'invoice'
]
=
invoice
)
payment_transaction
.
confirm
()
payment_transaction
.
start
()
# XXX More info needed
payment_transaction
.
checkConsistency
()
def
test_automated_person_high_not_paid_locking
(
self
):
def
test_automated_person_high_not_paid_locking
(
self
):
"""Test that a person is automatically locked by an alarm if payment has
"""Test that a person is automatically locked by an alarm if payment has
...
@@ -393,16 +400,7 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
...
@@ -393,16 +400,7 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
CheckPersonUnlockedState
\
CheckPersonUnlockedState
\
Tic
\
Tic
\
Logout
\
Logout
\
\
'
+
self
.
lock_user_string
()
+
'
\
LoginERP5TypeTestCase
\
CreateHighBalanceNotPaidPayment
\
Tic
\
Logout
\
\
TriggerLockPersonAlarm
\
Tic
\
Logout
\
\
LoginWebUser
\
LoginWebUser
\
CheckPersonLockedState
\
CheckPersonLockedState
\
Tic
\
Tic
\
...
@@ -529,13 +527,8 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
...
@@ -529,13 +527,8 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
Tic
\
Tic
\
Logout
\
Logout
\
'
+
\
'
+
\
self
.
create_new_user_instance_sequence_string
+
'
\
self
.
create_new_user_instance_sequence_string
+
\
LoginERP5TypeTestCase
\
self
.
lock_user_string
()
+
'
\
CreateHighBalanceNotPaidPayment
\
Tic
\
\
TriggerLockPersonAlarm
\
Tic
\
CheckInstanceLocked
\
CheckInstanceLocked
\
\
\
DeliverPayment
\
DeliverPayment
\
...
@@ -592,9 +585,14 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
...
@@ -592,9 +585,14 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
def
lock_user_string
(
self
):
def
lock_user_string
(
self
):
return
'
\
return
'
\
LoginERP5TypeTestCase
\
LoginERP5TypeTestCase
\
CreateHighBalance
NotPaidPayment
\
CreateHighBalance
InvoiceWebUser
\
Tic
\
Tic
\
\
PlanInvoice
\
Tic
\
ConfirmInvoice
\
StartInvoice
\
Tic
\
CheckWebUserBalanceHighAmount
\
TriggerLockPersonAlarm
\
TriggerLockPersonAlarm
\
Tic
\
Tic
\
Logout
\
Logout
\
...
...
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