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
Ivan Tyagov
slapos.core
Commits
3df8d4f2
Commit
3df8d4f2
authored
Nov 08, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initialise local_permission_slapos_interaction_workflow testing.
parent
b0488ab9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
114 additions
and
3 deletions
+114
-3
master/bt5/slapos_erp5/TestTemplateItem/testSlapOSLocalPermissionSlapOSInteractionWorkflow.py
...tem/testSlapOSLocalPermissionSlapOSInteractionWorkflow.py
+110
-0
master/bt5/slapos_erp5/bt/revision
master/bt5/slapos_erp5/bt/revision
+1
-1
master/bt5/slapos_erp5/bt/template_local_roles_list
master/bt5/slapos_erp5/bt/template_local_roles_list
+2
-2
master/bt5/slapos_erp5/bt/template_test_id_list
master/bt5/slapos_erp5/bt/template_test_id_list
+1
-0
No files found.
master/bt5/slapos_erp5/TestTemplateItem/testSlapOSLocalPermissionSlapOSInteractionWorkflow.py
0 → 100644
View file @
3df8d4f2
# Copyright (c) 2002-2012 Nexedi SA and Contributors. All Rights Reserved.
from
testSlapOSGroupRoleSecurity
import
TestSlapOSGroupRoleSecurityMixin
import
transaction
class
TestSlapOSLocalPermissionSlapOSInteractionWorkflow
(
TestSlapOSGroupRoleSecurityMixin
):
def
_makePerson
(
self
):
new_id
=
self
.
generateNewId
()
self
.
person_user
=
self
.
portal
.
person_module
.
template_member
.
\
Base_createCloneDocument
(
batch_mode
=
1
)
self
.
person_user
.
edit
(
title
=
"live_test_%s"
%
new_id
,
reference
=
"live_test_%s"
%
new_id
,
)
self
.
person_reference
=
self
.
person_user
.
getReference
()
def
test_ComputerModel_edit
(
self
):
self
.
_makePerson
()
model
=
self
.
portal
.
computer_model_module
.
newContent
(
portal_type
=
'Computer Model'
)
self
.
assertSecurityGroup
(
model
,
[
'G-COMPANY'
,
self
.
user_id
],
False
)
model
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
transaction
.
commit
()
self
.
assertSecurityGroup
(
model
,
[
'G-COMPANY'
,
self
.
user_id
,
self
.
person_reference
],
False
)
def
test_ComputerNetwork_edit
(
self
):
self
.
_makePerson
()
network
=
self
.
portal
.
computer_network_module
.
newContent
(
portal_type
=
'Computer Network'
)
self
.
assertSecurityGroup
(
network
,
[
'G-COMPANY'
,
self
.
user_id
,
'R-SHADOW-PERSON'
],
False
)
network
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
transaction
.
commit
()
self
.
assertSecurityGroup
(
network
,
[
'G-COMPANY'
,
self
.
user_id
,
self
.
person_reference
,
'R-SHADOW-PERSON'
],
False
)
def
test_Computer_setReference
(
self
):
computer
=
self
.
portal
.
computer_module
.
newContent
(
portal_type
=
'Computer'
)
self
.
assertSecurityGroup
(
computer
,
[
'G-COMPANY'
,
self
.
user_id
],
False
)
computer
.
edit
(
reference
=
'TESTCOMP-%s'
%
self
.
generateNewId
())
transaction
.
commit
()
self
.
assertSecurityGroup
(
computer
,
[
'G-COMPANY'
,
self
.
user_id
,
computer
.
getReference
()],
False
)
def
test_Computer_setSourceAdministration
(
self
):
self
.
_makePerson
()
computer
=
self
.
portal
.
computer_module
.
newContent
(
portal_type
=
'Computer'
)
self
.
assertSecurityGroup
(
computer
,
[
'G-COMPANY'
,
self
.
user_id
],
False
)
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
transaction
.
commit
()
self
.
assertSecurityGroup
(
computer
,
[
'G-COMPANY'
,
self
.
user_id
,
self
.
person_reference
],
False
)
def
test_Computer_setAllocationScope
(
self
):
computer
=
self
.
portal
.
computer_module
.
newContent
(
portal_type
=
'Computer'
)
self
.
assertSecurityGroup
(
computer
,
[
'G-COMPANY'
,
self
.
user_id
],
False
)
computer
.
edit
(
allocation_scope
=
'open/public'
)
transaction
.
commit
()
self
.
assertSecurityGroup
(
computer
,
[
'G-COMPANY'
,
self
.
user_id
,
'R-SHADOW-PERSON'
],
False
)
def
test_Computer_setDestinationSection
(
self
):
self
.
_makePerson
()
computer
=
self
.
portal
.
computer_module
.
newContent
(
portal_type
=
'Computer'
)
self
.
assertSecurityGroup
(
computer
,
[
'G-COMPANY'
,
self
.
user_id
],
False
)
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
transaction
.
commit
()
self
.
assertSecurityGroup
(
computer
,
[
'G-COMPANY'
,
self
.
user_id
,
self
.
person_reference
],
False
)
def
test_Computer_reindexObject
(
self
):
computer
=
self
.
portal
.
computer_module
.
template_computer
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
self
.
tic
()
comment
=
'recursiveReindexObject triggered on reindexObject'
def
verify_recursiveReindexObject_call
(
self
,
*
args
,
**
kw
):
if
self
.
getRelativeUrl
()
==
computer
.
getRelativeUrl
():
if
computer
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
]
!=
comment
:
computer
.
portal_workflow
.
doActionFor
(
computer
,
action
=
'edit_action'
,
comment
=
comment
)
else
:
return
self
.
recursiveReindexObject_call
(
*
args
,
**
kw
)
# Replace recursiveReindexObject by a dummy method
from
Products.ERP5Type.Core.Folder
import
Folder
Folder
.
recursiveReindexObject_call
=
Folder
.
recursiveReindexObject
Folder
.
recursiveReindexObject
=
verify_recursiveReindexObject_call
try
:
computer
.
reindexObject
()
self
.
tic
()
finally
:
Folder
.
recursiveReindexObject
=
Folder
.
recursiveReindexObject_call
self
.
assertEqual
(
comment
,
computer
.
workflow_history
[
'edit_workflow'
][
-
1
][
'comment'
])
master/bt5/slapos_erp5/bt/revision
View file @
3df8d4f2
61
62
\ No newline at end of file
\ No newline at end of file
master/bt5/slapos_erp5/bt/template_local_roles_list
View file @
3df8d4f2
...
@@ -2,6 +2,7 @@ computer_model_module
...
@@ -2,6 +2,7 @@ computer_model_module
computer_module
computer_module
computer_network_module
computer_network_module
credential_update_module
credential_update_module
data_set_module
document_module
document_module
hosting_subscription_module
hosting_subscription_module
image_module
image_module
...
@@ -11,5 +12,4 @@ portal_contributions
...
@@ -11,5 +12,4 @@ portal_contributions
software_installation_module
software_installation_module
software_instance_module
software_instance_module
software_product_module
software_product_module
software_release_module
software_release_module
data_set_module
\ No newline at end of file
\ No newline at end of file
master/bt5/slapos_erp5/bt/template_test_id_list
View file @
3df8d4f2
testSlapOSGroupRoleSecurity
testSlapOSGroupRoleSecurity
testSlapOSLocalPermissionSlapOSInteractionWorkflow
testSlapOSSkinSelection
testSlapOSSkinSelection
\ No newline at end of file
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