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
Klaus Wölfel
slapos.core
Commits
01e8a5ed
Commit
01e8a5ed
authored
Dec 01, 2015
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: add new tests for consumption document
parent
d13e45dc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
1 deletion
+29
-1
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
...l_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
+29
-1
No files found.
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
View file @
01e8a5ed
...
@@ -2016,8 +2016,9 @@ class TestConsumptionDocumentModule(TestSlapOSGroupRoleSecurityMixin):
...
@@ -2016,8 +2016,9 @@ class TestConsumptionDocumentModule(TestSlapOSGroupRoleSecurityMixin):
def
test
(
self
):
def
test
(
self
):
module
=
self
.
portal
.
consumption_document_module
module
=
self
.
portal
.
consumption_document_module
self
.
assertSecurityGroup
(
module
,
self
.
assertSecurityGroup
(
module
,
[
'R-COMPUTER'
,
'zope'
,
'G-COMPANY'
],
False
)
[
'R-COMPUTER'
,
'
R-MEMBER'
,
'
zope'
,
'G-COMPANY'
],
False
)
self
.
assertRoles
(
module
,
'R-COMPUTER'
,
[
'Author'
])
self
.
assertRoles
(
module
,
'R-COMPUTER'
,
[
'Author'
])
self
.
assertRoles
(
module
,
'R-MEMBER'
,
[
'Auditor'
,
'Author'
])
self
.
assertRoles
(
module
,
'G-COMPANY'
,
[
'Author'
,
'Auditor'
])
self
.
assertRoles
(
module
,
'G-COMPANY'
,
[
'Author'
,
'Auditor'
])
self
.
assertRoles
(
module
,
'zope'
,
[
'Owner'
])
self
.
assertRoles
(
module
,
'zope'
,
[
'Owner'
])
...
@@ -2032,6 +2033,33 @@ class TestComputerConsumptionTioXMLFile(TestSlapOSGroupRoleSecurityMixin):
...
@@ -2032,6 +2033,33 @@ class TestComputerConsumptionTioXMLFile(TestSlapOSGroupRoleSecurityMixin):
self
.
assertRoles
(
text
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
text
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
text
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
text
,
self
.
user_id
,
[
'Owner'
])
class
TestUserConsumptionHTMLFile
(
TestSlapOSGroupRoleSecurityMixin
):
def
test_GroupCompany
(
self
):
text
=
self
.
portal
.
consumption_document_module
.
newContent
(
portal_type
=
'User Consumption HTML File'
)
self
.
assertSecurityGroup
(
text
,
[
'G-COMPANY'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
text
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
text
,
self
.
user_id
,
[
'Owner'
])
def
test_CustomerAssignee
(
self
):
customer_reference
=
'TESTPERSON-%s'
%
self
.
generateNewId
()
customer
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
reference
=
customer_reference
)
reference
=
'TESTRC-%s'
%
self
.
generateNewId
()
html_document
=
self
.
portal
.
consumption_document_module
.
newContent
(
portal_type
=
'User Consumption HTML File'
,
reference
=
reference
,
contributor
=
customer
.
getRelativeUrl
())
html_document
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
html_document
,
[
'G-COMPANY'
,
customer_reference
,
self
.
user_id
],
False
)
self
.
assertRoles
(
html_document
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
html_document
,
customer_reference
,
[
'Assignee'
])
self
.
assertRoles
(
html_document
,
self
.
user_id
,
[
'Owner'
])
class
TestCloudContractModule
(
TestSlapOSGroupRoleSecurityMixin
):
class
TestCloudContractModule
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
(
self
):
def
test
(
self
):
module
=
self
.
portal
.
cloud_contract_module
module
=
self
.
portal
.
cloud_contract_module
...
...
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