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
ec0e225b
Commit
ec0e225b
authored
Feb 06, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Proof that user with bad balance cannot request.
parent
d0e5e870
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
4 deletions
+43
-4
master/product/Vifib/tests/testVifibSlapComputerPartitionLock.py
...product/Vifib/tests/testVifibSlapComputerPartitionLock.py
+43
-4
No files found.
master/product/Vifib/tests/testVifibSlapComputerPartitionLock.py
View file @
ec0e225b
...
...
@@ -4,7 +4,7 @@ from testVifibSlapWebService import TestVifibSlapWebServiceMixin
from
Products.DCWorkflow.DCWorkflow
import
ValidationFailed
from
random
import
random
from
slapos
import
slap
from
AccessControl
import
Unauthorized
from
zExceptions
import
Unauthorized
from
DateTime
import
DateTime
from
Products.ERP5Type.tests.backportUnittest
import
skip
...
...
@@ -128,17 +128,56 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
sla_xml
=
sequence
.
get
(
'sla_xml'
),
**
kw
)
def
stepSoftwareInstanceSaleOrderConfirmRaisesUnauthorized
(
self
,
sequence
,
**
kw
):
"""Checks that current software instance is realted only with sale order
and that this sale order cannot be confirmed because of Unauthorized
It means that user has bad balance."""
software_instance
=
self
.
portal
.
portal_catalog
.
getResultValue
(
uid
=
sequence
[
'software_instance_uid'
])
aggregate_value_list
=
software_instance
.
getAggregateRelatedValueList
(
portal_type
=
[
self
.
sale_packing_list_line_portal_type
,
self
.
sale_order_line_portal_type
])
self
.
assertEqual
(
1
,
len
(
aggregate_value_list
))
self
.
assertTrue
(
self
.
sale_order_line_portal_type
in
[
q
.
getPortalType
()
for
\
q
in
aggregate_value_list
])
sale_order_line
=
aggregate_value_list
[
0
]
sale_order
=
sale_order_line
.
getParentValue
()
self
.
assertRaises
(
Unauthorized
,
sale_order
.
confirm
)
def
stepAssertNoComputerPartition
(
self
,
sequence
,
**
kw
):
"""Sets in sequence computer partition parameters related to current
software instance"""
software_instance
=
self
.
portal
.
portal_catalog
.
getResultValue
(
uid
=
sequence
[
'software_instance_uid'
])
delivery_line_list
=
[
q
for
q
in
software_instance
.
getAggregateRelatedValueList
(
portal_type
=
self
.
sale_packing_list_line_portal_type
)]
self
.
assertEqual
(
0
,
len
(
delivery_line_list
))
def
test_negative_person_balance_request
(
self
):
"""Locked person can not request
"""
sequence_list
=
SequenceList
()
sequence_string
=
\
self
.
prepare_installed_software_release_sequence_string
+
\
self
.
register_new_user_sequence_string
+
'
\
self
.
register_new_user_sequence_string
\
+
self
.
lock_user_string
()
+
'
\
LoginWebUser
\
CheckPersonLockedState
\
PersonRequestIsForbidden
\
PersonRequestSoftwareInstance
\
Tic
\
Logout
\
\
LoginDefaultUser
\
SoftwareInstanceSaleOrderConfirmRaisesUnauthorized
\
ConfirmOrderedSaleOrderActiveSense
\
Tic
\
AssertNoComputerPartition
\
Logout
\
\
LoginERP5TypeTestCase
\
...
...
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