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
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
Richard
erp5
Commits
166b7b15
Commit
166b7b15
authored
Jul 13, 2018
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Catalog: Create ERP5Site_filterUserIdList in tests which can use it.
parent
976e8f92
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
3 deletions
+37
-3
product/ERP5Catalog/tests/testERP5Catalog.py
product/ERP5Catalog/tests/testERP5Catalog.py
+37
-3
No files found.
product/ERP5Catalog/tests/testERP5Catalog.py
View file @
166b7b15
...
@@ -2266,7 +2266,15 @@ VALUES
...
@@ -2266,7 +2266,15 @@ VALUES
sql_catalog
.
sql_catalog_role_keys
=
(
sql_catalog
.
sql_catalog_role_keys
=
(
'Assignee | %s.viewable_assignee_reference'
%
\
'Assignee | %s.viewable_assignee_reference'
%
\
local_roles_table
,)
local_roles_table
,)
createZODBPythonScript
(
self
.
portal
.
portal_skins
.
custom
,
'ERP5Site_filterUserIdSet'
,
'group_id_list'
,
'actual_user_set = %r
\
n
'
'return [x for x in group_id_list if x in actual_user_set]'
%
(
(
user1
,
user2
),
),
)
current_sql_search_tables
=
sql_catalog
.
sql_search_tables
current_sql_search_tables
=
sql_catalog
.
sql_search_tables
sql_catalog
.
sql_search_tables
=
sql_catalog
.
sql_search_tables
+
\
sql_catalog
.
sql_search_tables
=
sql_catalog
.
sql_search_tables
+
\
[
local_roles_table
]
[
local_roles_table
]
...
@@ -2315,6 +2323,7 @@ VALUES
...
@@ -2315,6 +2323,7 @@ VALUES
result
=
obj
.
portal_catalog
(
portal_type
=
portal_type
,
local_roles
=
'Auditor'
)
result
=
obj
.
portal_catalog
(
portal_type
=
portal_type
,
local_roles
=
'Auditor'
)
self
.
assertSameSet
([
obj2
,
],
[
x
.
getObject
()
for
x
in
result
])
self
.
assertSameSet
([
obj2
,
],
[
x
.
getObject
()
for
x
in
result
])
finally
:
finally
:
self
.
portal
.
portal_skins
.
custom
.
manage_delObjects
(
ids
=
[
'ERP5Site_filterUserIdSet'
])
sql_catalog
.
sql_catalog_object_list
=
\
sql_catalog
.
sql_catalog_object_list
=
\
current_sql_catalog_object_list
current_sql_catalog_object_list
sql_catalog
.
sql_clear_catalog
=
\
sql_catalog
.
sql_clear_catalog
=
\
...
@@ -2432,7 +2441,14 @@ VALUES
...
@@ -2432,7 +2441,14 @@ VALUES
sql_catalog
.
sql_catalog_role_keys
=
(
sql_catalog
.
sql_catalog_role_keys
=
(
'Assignee | %s.viewable_assignee_reference'
%
\
'Assignee | %s.viewable_assignee_reference'
%
\
local_roles_table
,)
local_roles_table
,)
createZODBPythonScript
(
self
.
portal
.
portal_skins
.
custom
,
'ERP5Site_filterUserIdSet'
,
'group_id_list'
,
'return [x for x in group_id_list if x == %r]'
%
(
user1
,
),
)
current_sql_search_tables
=
sql_catalog
.
sql_search_tables
current_sql_search_tables
=
sql_catalog
.
sql_search_tables
sql_catalog
.
sql_search_tables
=
sql_catalog
.
sql_search_tables
+
\
sql_catalog
.
sql_search_tables
=
sql_catalog
.
sql_search_tables
+
\
[
local_roles_table
]
[
local_roles_table
]
...
@@ -2575,6 +2591,7 @@ VALUES
...
@@ -2575,6 +2591,7 @@ VALUES
**
count_result_kw
)))
**
count_result_kw
)))
finally
:
finally
:
self
.
portal
.
portal_skins
.
custom
.
manage_delObjects
(
ids
=
[
'ERP5Site_filterUserIdSet'
])
sql_catalog
.
sql_catalog_object_list
=
\
sql_catalog
.
sql_catalog_object_list
=
\
current_sql_catalog_object_list
current_sql_catalog_object_list
sql_catalog
.
sql_clear_catalog
=
\
sql_catalog
.
sql_clear_catalog
=
\
...
@@ -2683,7 +2700,14 @@ VALUES
...
@@ -2683,7 +2700,14 @@ VALUES
'Owner | viewable_owner'
,
'Owner | viewable_owner'
,
'Assignee | %s.viewable_assignee_reference'
%
\
'Assignee | %s.viewable_assignee_reference'
%
\
local_roles_table
,)
local_roles_table
,)
createZODBPythonScript
(
self
.
portal
.
portal_skins
.
custom
,
'ERP5Site_filterUserIdSet'
,
'group_id_list'
,
'return [x for x in group_id_list if x == %r]'
%
(
user1
,
),
)
current_sql_search_tables
=
sql_catalog
.
sql_search_tables
current_sql_search_tables
=
sql_catalog
.
sql_search_tables
sql_catalog
.
sql_search_tables
=
sql_catalog
.
sql_search_tables
+
\
sql_catalog
.
sql_search_tables
=
sql_catalog
.
sql_search_tables
+
\
[
local_roles_table
]
[
local_roles_table
]
...
@@ -2818,6 +2842,7 @@ VALUES
...
@@ -2818,6 +2842,7 @@ VALUES
**
count_result_kw
)))
**
count_result_kw
)))
finally
:
finally
:
self
.
portal
.
portal_skins
.
custom
.
manage_delObjects
(
ids
=
[
'ERP5Site_filterUserIdSet'
])
sql_catalog
.
sql_catalog_object_list
=
\
sql_catalog
.
sql_catalog_object_list
=
\
current_sql_catalog_object_list
current_sql_catalog_object_list
sql_catalog
.
sql_clear_catalog
=
\
sql_catalog
.
sql_clear_catalog
=
\
...
@@ -2928,6 +2953,14 @@ VALUES
...
@@ -2928,6 +2953,14 @@ VALUES
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
)
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
)
user_id
=
person
.
Person_getUserId
()
user_id
=
person
.
Person_getUserId
()
createZODBPythonScript
(
self
.
portal
.
portal_skins
.
custom
,
'ERP5Site_filterUserIdSet'
,
'group_id_list'
,
'return [x for x in group_id_list if x == %r]'
%
(
user_id
,
),
)
person
.
manage_setLocalRoles
(
user_id
,
[
'Assignee'
])
person
.
manage_setLocalRoles
(
user_id
,
[
'Assignee'
])
self
.
tic
()
self
.
tic
()
...
@@ -2943,6 +2976,7 @@ VALUES
...
@@ -2943,6 +2976,7 @@ VALUES
# check that user has optimised security declaration
# check that user has optimised security declaration
self
.
assertEqual
(
local_roles_table_result
[
'viewable_assignee_reference'
],
user_id
)
self
.
assertEqual
(
local_roles_table_result
[
'viewable_assignee_reference'
],
user_id
)
finally
:
finally
:
self
.
portal
.
portal_skins
.
custom
.
manage_delObjects
(
ids
=
[
'ERP5Site_filterUserIdSet'
])
sql_catalog
.
sql_catalog_object_list
=
\
sql_catalog
.
sql_catalog_object_list
=
\
current_sql_catalog_object_list
current_sql_catalog_object_list
sql_catalog
.
sql_clear_catalog
=
\
sql_catalog
.
sql_clear_catalog
=
\
...
...
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