Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Aurélien Vermylen
erp5
Commits
6ee39f47
Commit
6ee39f47
authored
Dec 04, 2015
by
Kazuhiko Shiozaki
Committed by
Cédric Le Ninivin
Jan 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: check if assignment change is effective immediately.
parent
64cdd322
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
7 deletions
+28
-7
product/ERP5Security/tests/testERP5Security.py
product/ERP5Security/tests/testERP5Security.py
+28
-7
No files found.
product/ERP5Security/tests/testERP5Security.py
View file @
6ee39f47
...
@@ -49,7 +49,7 @@ class TestUserManagement(ERP5TypeTestCase):
...
@@ -49,7 +49,7 @@ class TestUserManagement(ERP5TypeTestCase):
def
getBusinessTemplateList
(
self
):
def
getBusinessTemplateList
(
self
):
"""List of BT to install. """
"""List of BT to install. """
return
(
'erp5_base'
,)
return
(
'erp5_base'
,
'erp5_administration'
,
)
def
beforeTearDown
(
self
):
def
beforeTearDown
(
self
):
"""Clears person module and invalidate caches when tests are finished."""
"""Clears person module and invalidate caches when tests are finished."""
...
@@ -552,12 +552,9 @@ class TestLocalRoleManagement(ERP5TypeTestCase):
...
@@ -552,12 +552,9 @@ class TestLocalRoleManagement(ERP5TypeTestCase):
base_cat
.
newContent
(
portal_type
=
'Category'
,
base_cat
.
newContent
(
portal_type
=
'Category'
,
id
=
'subcat'
,
id
=
'subcat'
,
codification
=
"%s1"
%
code
)
codification
=
"%s1"
%
code
)
# add another function subcategory.
base_cat
.
newContent
(
portal_type
=
'Category'
,
function_category
=
category_tool
[
'function'
]
id
=
'another_subcat'
,
if
function_category
.
get
(
'another_subcat'
,
None
)
is
None
:
codification
=
"%s2"
%
code
)
function_category
.
newContent
(
portal_type
=
'Category'
,
id
=
'another_subcat'
,
codification
=
'F2'
)
self
.
defined_category
=
"group/subcat
\
n
"
\
self
.
defined_category
=
"group/subcat
\
n
"
\
"site/subcat
\
n
"
\
"site/subcat
\
n
"
\
"function/subcat"
"function/subcat"
...
@@ -643,6 +640,30 @@ class TestLocalRoleManagement(ERP5TypeTestCase):
...
@@ -643,6 +640,30 @@ class TestLocalRoleManagement(ERP5TypeTestCase):
self
.
assertEqual
([
'Assignor'
],
obj
.
__ac_local_roles__
.
get
(
'F1_G1_S1'
))
self
.
assertEqual
([
'Assignor'
],
obj
.
__ac_local_roles__
.
get
(
'F1_G1_S1'
))
self
.
assertTrue
(
'Assignor'
in
user
.
getRolesInContext
(
obj
))
self
.
assertTrue
(
'Assignor'
in
user
.
getRolesInContext
(
obj
))
self
.
assertFalse
(
'Assignee'
in
user
.
getRolesInContext
(
obj
))
self
.
assertFalse
(
'Assignee'
in
user
.
getRolesInContext
(
obj
))
# check if assignment change is effective immediately
self
.
login
()
res
=
self
.
publish
(
self
.
portal
.
absolute_url_path
()
+
\
'/Base_viewSecurity?__ac_name=%s&__ac_password=%s'
%
\
(
self
.
username
,
self
.
username
))
self
.
assertEqual
([
x
for
x
in
res
.
body
.
splitlines
()
if
x
.
startswith
(
'-->'
)],
[
"--> ['F1_G1_S1']"
])
assignment
=
self
.
person
.
newContent
(
portal_type
=
'Assignment'
,
group
=
'subcat'
,
site
=
'subcat'
,
function
=
'another_subcat'
)
assignment
.
open
()
res
=
self
.
publish
(
self
.
portal
.
absolute_url_path
()
+
\
'/Base_viewSecurity?__ac_name=%s&__ac_password=%s'
%
\
(
self
.
username
,
self
.
username
))
self
.
assertEqual
([
x
for
x
in
res
.
body
.
splitlines
()
if
x
.
startswith
(
'-->'
)],
[
"--> ['F1_G1_S1']"
,
"--> ['F2_G1_S1']"
])
assignment
.
setGroup
(
'another_subcat'
)
res
=
self
.
publish
(
self
.
portal
.
absolute_url_path
()
+
\
'/Base_viewSecurity?__ac_name=%s&__ac_password=%s'
%
\
(
self
.
username
,
self
.
username
))
self
.
assertEqual
([
x
for
x
in
res
.
body
.
splitlines
()
if
x
.
startswith
(
'-->'
)],
[
"--> ['F1_G1_S1']"
,
"--> ['F2_G2_S1']"
])
self
.
abort
()
self
.
abort
()
def
testLocalRolesGroupId
(
self
):
def
testLocalRolesGroupId
(
self
):
...
...
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