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
9e030f0f
Commit
9e030f0f
authored
Aug 29, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move test to correct class.
parent
accabc14
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
36 deletions
+37
-36
product/ERP5Security/tests/testERP5Security.py
product/ERP5Security/tests/testERP5Security.py
+37
-36
No files found.
product/ERP5Security/tests/testERP5Security.py
View file @
9e030f0f
...
...
@@ -409,6 +409,43 @@ class TestUserManagement(ERP5TypeTestCase):
self
.
tic
()
self
.
assertEqual
(
None
,
person
.
getReference
())
def
testERP5CertificateAuthorityAuthenticationPlugin
(
self
):
"""
Make sure that we can grant security using a
ERP5 Certificate Authority Authentication Plugin.
"""
portal
=
self
.
portal
uf
=
portal
.
acl_users
uf
.
manage_addProduct
[
'ERP5Security'
].
\
addERP5CertificateAuthorityAuthenticationPlugin
(
id
=
'erp5_certificate_authority_authentication_plugin'
,
title
=
'ERP5 Certificate Authority Authentication Plugin'
,)
plugin
=
getattr
(
uf
,
'erp5_certificate_authority_authentication_plugin'
)
plugin
.
manage_activateInterfaces
(
interfaces
=
[
'IExtractionPlugin'
,
'IAuthenticationPlugin'
])
self
.
stepTic
()
reference
=
'external_auth_person'
loginable_person
=
self
.
getPersonModule
().
newContent
(
portal_type
=
'Person'
,
reference
=
reference
,
password
=
'guest'
)
assignment
=
loginable_person
.
newContent
(
portal_type
=
'Assignment'
,
function
=
'another_subcat'
)
assignment
.
open
()
self
.
stepTic
()
base_url
=
portal
.
absolute_url
(
relative
=
1
)
response
=
self
.
publish
(
base_url
)
self
.
assertEqual
(
response
.
getStatus
(),
302
)
response
=
self
.
publish
(
base_url
,
env
=
{
"REMOTE_USER"
:
reference
})
self
.
assertEqual
(
response
.
getStatus
(),
200
)
self
.
assertTrue
(
reference
in
response
.
getBody
())
class
TestLocalRoleManagement
(
ERP5TypeTestCase
):
"""Tests Local Role Management with ERP5Security.
...
...
@@ -824,42 +861,6 @@ class TestLocalRoleManagement(ERP5TypeTestCase):
self
.
assertEqual
(
response
.
getStatus
(),
200
)
self
.
assertTrue
(
reference
in
response
.
getBody
())
def
testERP5CertificateAuthorityAuthenticationPlugin
(
self
):
"""
Make sure that we can grant security using a
ERP5 Certificate Authority Authentication Plugin.
"""
portal
=
self
.
portal
uf
=
portal
.
acl_users
uf
.
manage_addProduct
[
'ERP5Security'
].
\
addERP5CertificateAuthorityAuthenticationPlugin
(
id
=
'erp5_certificate_authority_authentication_plugin'
,
title
=
'ERP5 Certificate Authority Authentication Plugin'
,)
plugin
=
getattr
(
uf
,
'erp5_certificate_authority_authentication_plugin'
)
plugin
.
manage_activateInterfaces
(
interfaces
=
[
'IExtractionPlugin'
,
'IAuthenticationPlugin'
])
self
.
stepTic
()
reference
=
'external_auth_person'
loginable_person
=
self
.
getPersonModule
().
newContent
(
portal_type
=
'Person'
,
reference
=
reference
,
password
=
'guest'
)
assignment
=
loginable_person
.
newContent
(
portal_type
=
'Assignment'
,
function
=
'another_subcat'
)
assignment
.
open
()
self
.
stepTic
()
base_url
=
portal
.
absolute_url
(
relative
=
1
)
response
=
self
.
publish
(
base_url
)
self
.
assertEqual
(
response
.
getStatus
(),
302
)
response
=
self
.
publish
(
base_url
,
env
=
{
"REMOTE_USER"
:
reference
})
self
.
assertEqual
(
response
.
getStatus
(),
200
)
self
.
assertTrue
(
reference
in
response
.
getBody
())
def
_createZodbUser
(
self
,
login
,
role_list
=
None
):
if
role_list
is
None
:
role_list
=
[
'Member'
,
'Assignee'
,
'Assignor'
,
'Author'
,
'Auditor'
,
...
...
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