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
9c27603f
Commit
9c27603f
authored
Jul 23, 2018
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: If the Cloud Contract Preference is disabled any user can allocate.
parent
c6694951
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSContractSkins.py
...em/portal_components/test.erp5.testSlapOSContractSkins.py
+7
-4
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSContractSkins.xml
...m/portal_components/test.erp5.testSlapOSContractSkins.xml
+1
-3
No files found.
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSContractSkins.py
View file @
9c27603f
...
...
@@ -3,7 +3,6 @@ from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixinWithAbort
from
zExceptions
import
Unauthorized
from
DateTime
import
DateTime
import
transaction
class
TestSlapOSSoftwareInstance_requestValidationPayment
(
SlapOSTestCaseMixinWithAbort
):
...
...
@@ -272,9 +271,10 @@ class TestSlapOSPerson_isAllowedToAllocate(SlapOSTestCaseMixinWithAbort):
def
test_not_allowed_by_default_with_disabled_preference
(
self
):
preference
=
self
.
portal
.
portal_preferences
.
getActiveSystemPreference
()
person
=
self
.
createPerson
()
# If Contract is disabled, anyone can allocate
preference
.
setPreferredCloudContractEnabled
(
False
)
result
=
person
.
Person_isAllowedToAllocate
()
self
.
assertEquals
(
result
,
Fals
e
)
self
.
assertEquals
(
result
,
Tru
e
)
def
test_allowed_if_has_a_validated_contract
(
self
):
preference
=
self
.
portal
.
portal_preferences
.
getActiveSystemPreference
()
...
...
@@ -300,6 +300,7 @@ class TestSlapOSPerson_isAllowedToAllocate(SlapOSTestCaseMixinWithAbort):
preference
.
setPreferredCloudContractEnabled
(
0
)
self
.
tic
()
result
=
person
.
Person_isAllowedToAllocate
()
# If Contract is disabled, anyone can allocate
self
.
assertEquals
(
result
,
True
)
...
...
@@ -327,7 +328,8 @@ class TestSlapOSPerson_isAllowedToAllocate(SlapOSTestCaseMixinWithAbort):
preference
.
setPreferredCloudContractEnabled
(
False
)
self
.
tic
()
result
=
person
.
Person_isAllowedToAllocate
()
self
.
assertEquals
(
result
,
False
)
# If Contract is disabled, anyone can allocate
self
.
assertEquals
(
result
,
True
)
def
test_not_allowed_if_no_related_contract
(
self
):
preference
=
self
.
portal
.
portal_preferences
.
getActiveSystemPreference
()
...
...
@@ -347,5 +349,6 @@ class TestSlapOSPerson_isAllowedToAllocate(SlapOSTestCaseMixinWithAbort):
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
contract
,
'validated'
)
self
.
tic
()
result
=
person
.
Person_isAllowedToAllocate
()
self
.
assertEquals
(
result
,
False
)
# If Contract is disabled, anyone can allocate
self
.
assertEquals
(
result
,
True
)
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSContractSkins.xml
View file @
9c27603f
...
...
@@ -45,9 +45,7 @@
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple>
<string>
W: 6, 0: Unused import transaction (unused-import)
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
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