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
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
82235674
Commit
82235674
authored
Dec 09, 2016
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: migrate to ERP5 Login authentication.
parent
e3f117a8
Changes
21
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
474 additions
and
264 deletions
+474
-264
bt5/erp5_user_tutorial_ui_test/SkinTemplateItem/portal_skins/erp5_user_tutorial_ui_test/Zuite_createAnotherFunctionalTestUser.py
...tutorial_ui_test/Zuite_createAnotherFunctionalTestUser.py
+7
-1
bt5/erp5_user_tutorial_ui_test/SkinTemplateItem/portal_skins/erp5_user_tutorial_ui_test/Zuite_createFunctionalTestUser.py
...5_user_tutorial_ui_test/Zuite_createFunctionalTestUser.py
+7
-1
bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/ERP5Site_createPersonToAskAccountRecover.py
...derjs_ui_test/ERP5Site_createPersonToAskAccountRecover.py
+6
-1
bt5/erp5_web_ui_test/SkinTemplateItem/portal_skins/erp5_web_ui_test/WebSiteModule_resetWebZuite.py
...tal_skins/erp5_web_ui_test/WebSiteModule_resetWebZuite.py
+8
-1
bt5/erp5_web_ung_role/TestTemplateItem/portal_components/test.erp5.testUNGSecurity.py
...mplateItem/portal_components/test.erp5.testUNGSecurity.py
+15
-0
bt5/erp5_web_ung_theme/TestTemplateItem/portal_components/test.erp5.testUNG.py
...e/TestTemplateItem/portal_components/test.erp5.testUNG.py
+2
-0
bt5/networkcache_erp5/TestTemplateItem/portal_components/test.erp5.ShaSecurityMixin.py
...plateItem/portal_components/test.erp5.ShaSecurityMixin.py
+7
-2
product/ERP5/tests/testAccounting_l10n_fr.py
product/ERP5/tests/testAccounting_l10n_fr.py
+1
-0
product/ERP5/tests/testBug.py
product/ERP5/tests/testBug.py
+1
-0
product/ERP5/tests/testCertificateAuthorityTool.py
product/ERP5/tests/testCertificateAuthorityTool.py
+1
-0
product/ERP5/tests/testERP5Base.py
product/ERP5/tests/testERP5Base.py
+2
-2
product/ERP5/tests/testERP5Commerce.py
product/ERP5/tests/testERP5Commerce.py
+1
-0
product/ERP5/tests/testERP5Credential.py
product/ERP5/tests/testERP5Credential.py
+19
-25
product/ERP5/tests/testPasswordTool.py
product/ERP5/tests/testPasswordTool.py
+71
-41
product/ERP5/tests/testWorklist.py
product/ERP5/tests/testWorklist.py
+1
-0
product/ERP5Banking/tests/TestERP5BankingMixin.py
product/ERP5Banking/tests/TestERP5BankingMixin.py
+4
-0
product/ERP5Catalog/tests/testERP5CatalogSecurityUidOptimization.py
...P5Catalog/tests/testERP5CatalogSecurityUidOptimization.py
+2
-0
product/ERP5Form/tests/testGUIwithSecurity.py
product/ERP5Form/tests/testGUIwithSecurity.py
+1
-0
product/ERP5OOo/tests/testDeferredStyle.py
product/ERP5OOo/tests/testDeferredStyle.py
+6
-1
product/ERP5Security/tests/testERP5Security.py
product/ERP5Security/tests/testERP5Security.py
+308
-188
product/ERP5Type/tests/ERP5TypeTestCase.py
product/ERP5Type/tests/ERP5TypeTestCase.py
+4
-1
No files found.
bt5/erp5_user_tutorial_ui_test/SkinTemplateItem/portal_skins/erp5_user_tutorial_ui_test/Zuite_createAnotherFunctionalTestUser.py
View file @
82235674
...
...
@@ -12,7 +12,6 @@ if person is None:
title
=
functional_test_username
)
person
.
edit
(
reference
=
functional_test_username
,
password
=
howto_dict
[
'functional_test_user_password'
],
default_email_text
=
howto_dict
[
'functional_test_user_email'
])
person
.
validate
()
...
...
@@ -23,6 +22,13 @@ if person is None:
function
=
'company/manager'
)
assignment
.
open
()
login
=
person
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
functional_test_username
,
password
=
howto_dict
[
'functional_test_user_password'
],
)
login
.
validate
()
# XXX (lucas): These tests must be able to run on an instance without security.
for
role
in
(
'Assignee'
,
'Assignor'
,
'Associate'
,
'Auditor'
,
'Owner'
):
portal
.
acl_users
.
zodb_roles
.
assignRoleToPrincipal
(
role
,
person
.
Person_getUserId
())
...
...
bt5/erp5_user_tutorial_ui_test/SkinTemplateItem/portal_skins/erp5_user_tutorial_ui_test/Zuite_createFunctionalTestUser.py
View file @
82235674
...
...
@@ -12,7 +12,6 @@ if person is None:
title
=
functional_test_username
)
person
.
edit
(
reference
=
functional_test_username
,
password
=
howto_dict
[
'functional_test_user_password'
],
default_email_text
=
howto_dict
[
'functional_test_user_email'
])
person
.
validate
()
...
...
@@ -23,6 +22,13 @@ if person is None:
function
=
'company/manager'
)
assignment
.
open
()
login
=
person
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
functional_test_username
,
password
=
howto_dict
[
'functional_test_user_password'
],
)
login
.
validate
()
# XXX (lucas): These tests must be able to run on an instance without security.
for
role
in
(
'Assignee'
,
'Assignor'
,
'Associate'
,
'Auditor'
,
'Owner'
):
portal
.
acl_users
.
zodb_roles
.
assignRoleToPrincipal
(
role
,
person
.
Person_getUserId
())
...
...
bt5/erp5_web_renderjs_ui_test/SkinTemplateItem/portal_skins/erp5_web_renderjs_ui_test/ERP5Site_createPersonToAskAccountRecover.py
View file @
82235674
...
...
@@ -11,10 +11,15 @@ else:
person
=
person_module
.
newContent
(
portal_type
=
"Person"
,
reference
=
user_id
,
id
=
user_id
,
password
=
new_password
,
default_email_text
=
"userA@example.invalid"
)
assignment
=
person
.
newContent
(
portal_type
=
'Assignment'
)
assignment
.
open
()
login
=
person
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
user_id
,
password
=
new_password
,
)
login
.
validate
()
# Make sure always a new password
person
.
setPassword
(
new_password
)
...
...
bt5/erp5_web_ui_test/SkinTemplateItem/portal_skins/erp5_web_ui_test/WebSiteModule_resetWebZuite.py
View file @
82235674
...
...
@@ -27,7 +27,7 @@ if not portal.person_module.has_key('test_webmaster'):
else
:
person
=
portal
.
person_module
.
test_webmaster
person
.
edit
(
first_name
=
'Test'
,
last_name
=
'Webmaster'
,
reference
=
'test_webmaster'
,
password
=
'test_webmaster'
)
reference
=
'test_webmaster'
)
person
.
setRole
(
'internal'
)
if
not
len
(
person
.
objectValues
(
portal_type
=
'Assignment'
)):
assignment
=
person
.
newContent
(
portal_type
=
'Assignment'
)
...
...
@@ -36,6 +36,13 @@ if not len(person.objectValues(portal_type='Assignment')):
stop_date
=
DateTime
(
'2990/12/31'
))
if
assignment
.
getValidationState
()
!=
'open'
:
assignment
.
open
()
if
not
len
(
person
.
objectValues
(
portal_type
=
'ERP5 Login'
)):
login
=
person
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
'test_webmaster'
,
password
=
'test_webmaster'
,
)
login
.
validate
()
if
person
.
getValidationState
()
!=
'validated'
:
person
.
validate
()
...
...
bt5/erp5_web_ung_role/TestTemplateItem/portal_components/test.erp5.testUNGSecurity.py
View file @
82235674
...
...
@@ -51,6 +51,11 @@ class TestUNGSecurity(ERP5TypeTestCase):
assignment
=
person
.
newContent
(
portal_type
=
'Assignment'
)
assignment
.
setFunction
(
"function/ung_user"
)
assignment
.
open
()
login
=
person
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
'ung_user'
,
)
login
.
validate
()
self
.
tic
()
def
testERP5Site_createNewWebDocumentAsAnonymous
(
self
):
...
...
@@ -82,6 +87,11 @@ class TestUNGSecurity(ERP5TypeTestCase):
assignment
=
person
.
newContent
(
portal_type
=
'Assignment'
)
assignment
.
setFunction
(
"function/ung_user"
)
assignment
.
open
()
login
=
person
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
'ung_user2'
,
)
login
.
validate
()
self
.
tic
()
self
.
loginByUserName
(
"ung_user"
)
self
.
changeSkin
(
"UNGDoc"
)
...
...
@@ -175,6 +185,11 @@ class TestUNGSecurity(ERP5TypeTestCase):
assignment
=
person
.
newContent
(
portal_type
=
'Assignment'
)
assignment
.
setFunction
(
"function/ung_user"
)
assignment
.
open
()
login
=
person
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
'ung_user2'
,
)
login
.
validate
()
self
.
tic
()
self
.
loginByUserName
(
"ung_user"
)
self
.
changeSkin
(
"UNGDoc"
)
...
...
bt5/erp5_web_ung_theme/TestTemplateItem/portal_components/test.erp5.testUNG.py
View file @
82235674
...
...
@@ -133,10 +133,12 @@ class TestUNG(ERP5TypeTestCase):
reference
=
"ung_new_user"
)
assignment
=
person
.
newContent
(
portal_type
=
'Assignment'
)
assignment
.
open
()
person
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
person
.
getReference
()).
validate
()
person
=
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
reference
=
"ung_new_user2"
)
assignment
=
person
.
newContent
(
portal_type
=
'Assignment'
)
assignment
.
open
()
person
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
person
.
getReference
()).
validate
()
self
.
tic
()
self
.
loginByUserName
(
"ung_new_user"
)
self
.
changeSkin
(
"UNGDoc"
)
...
...
bt5/networkcache_erp5/TestTemplateItem/portal_components/test.erp5.ShaSecurityMixin.py
View file @
82235674
...
...
@@ -52,8 +52,13 @@ class ShaSecurityMixin(object):
if
person
is
None
:
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
)
person
.
edit
(
first_name
=
reference
,
reference
=
reference
,
password
=
password
)
reference
=
reference
)
login
=
person
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
reference
,
password
=
password
,
)
login
.
validate
()
self
.
tic
()
create
=
True
...
...
product/ERP5/tests/testAccounting_l10n_fr.py
View file @
82235674
...
...
@@ -82,6 +82,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
default_email_text
=
self
.
recipient_email_address
)
assignment
=
person
.
newContent
(
portal_type
=
'Assignment'
)
assignment
.
open
()
person
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
self
.
username
).
validate
()
self
.
tic
()
uf
=
self
.
portal
.
acl_users
...
...
product/ERP5/tests/testBug.py
View file @
82235674
...
...
@@ -126,6 +126,7 @@ class TestBug(ERP5TypeTestCase):
start_date
=
'1980-01-01'
,
stop_date
=
'2099-12-31'
)
assignment
.
open
()
person
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
'dummy'
).
validate
()
self
.
tic
()
portal_type_list
=
[]
for
portal_type
in
(
self
.
project_portal_type
,
...
...
product/ERP5/tests/testCertificateAuthorityTool.py
View file @
82235674
...
...
@@ -50,6 +50,7 @@ class TestCertificateAuthority(ERP5TypeTestCase):
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
reference
=
login
,
password
=
login
)
person
.
newContent
(
portal_type
=
'Assignment'
).
open
()
person
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
login
).
validate
()
self
.
tic
()
return
login
...
...
product/ERP5/tests/testERP5Base.py
View file @
82235674
...
...
@@ -1167,14 +1167,14 @@ class TestERP5Base(ERP5TypeTestCase):
self
.
tic
()
# a user is created
user
=
self
.
portal
.
acl_users
.
getUser
ById
(
'user_login'
)
user
=
self
.
portal
.
acl_users
.
getUser
(
'user_login'
)
self
.
assertNotEquals
(
None
,
user
)
# and this user has a preference created
newSecurityManager
(
None
,
user
.
__of__
(
self
.
portal
.
acl_users
))
self
.
assertNotEquals
(
None
,
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Preference'
,
owner
=
'user_login'
))
owner
=
user
.
getId
()
))
# for his assignent group
self
.
assertEqual
(
'group/nexedi'
,
self
.
portal
.
portal_preferences
.
getPreferredSectionCategory
())
...
...
product/ERP5/tests/testERP5Commerce.py
View file @
82235674
...
...
@@ -227,6 +227,7 @@ class TestCommerce(ERP5TypeTestCase):
start_date
=
'1972-01-01'
,
stop_date
=
'2999-12-31'
,
group
=
group
,
destination_project
=
destination_project
)
assignment
.
open
()
person
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
reference
).
validate
()
self
.
tic
()
#XXX: Security hack (lucas)
...
...
product/ERP5/tests/testERP5Credential.py
View file @
82235674
...
...
@@ -303,8 +303,7 @@ class TestERP5Credential(ERP5TypeTestCase):
self
.
portal
.
ERP5Site_activeLogin
(
mail_message
.
getReference
())
self
.
login
()
self
.
tic
()
person
=
portal_catalog
.
getResultValue
(
reference
=
reference
,
portal_type
=
"Person"
)
person
=
self
.
portal
.
acl_users
.
getUser
(
reference
).
getUserValue
()
assignment_list
=
person
.
objectValues
(
portal_type
=
"Assignment"
)
self
.
assertEqual
(
len
(
assignment_list
),
1
)
assignment
=
assignment_list
[
0
]
...
...
@@ -380,7 +379,7 @@ class TestERP5Credential(ERP5TypeTestCase):
last_name
=
'Simpson'
,
reference
=
'homie'
)
self
.
assertEqual
(
len
(
result
),
1
)
sequence
.
edit
(
subscription_request
=
result
[
0
],
perso
n_reference
=
credential_reference
)
logi
n_reference
=
credential_reference
)
def
stepAcceptSubscriptionRequest
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
...
...
@@ -407,9 +406,9 @@ class TestERP5Credential(ERP5TypeTestCase):
# check homie can log in the system
self
.
_assertUserExists
(
'homie'
,
'secret'
)
self
.
login
(
'homie'
)
self
.
login
ByUserName
(
'homie'
)
from
AccessControl
import
getSecurityManager
self
.
assertEqual
(
getSecurityManager
().
getUser
().
get
IdOr
UserName
(),
'homie'
)
self
.
assertEqual
(
getSecurityManager
().
getUser
().
getUserName
(),
'homie'
)
def
stepCreateCredentialUpdate
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
'''
...
...
@@ -418,10 +417,9 @@ class TestERP5Credential(ERP5TypeTestCase):
'''
self
.
login
()
# get the 'homie' person object
person_module
=
self
.
portal
.
getDefaultModule
(
'Person'
)
result
=
person_module
.
searchFolder
(
reference
=
'homie'
)
result
=
self
.
portal
.
portal_catalog
(
portal_type
=
'ERP5 Login'
,
reference
=
'homie'
)
self
.
assertEqual
(
len
(
result
),
1
)
homie
=
result
[
0
]
homie
=
result
[
0
]
.
getParentValue
()
# create a credential update
credential_update_module
=
self
.
portal
.
getDefaultModule
(
\
...
...
@@ -453,9 +451,9 @@ class TestERP5Credential(ERP5TypeTestCase):
# check that informations on the person object have been updated
person_module
=
self
.
portal
.
getDefaultModule
(
'Person'
)
related_
person_result
=
person_module
.
searchFolder
(
reference
=
'homie'
)
self
.
assertEqual
(
len
(
related_
perso
n_result
),
1
)
related_person
=
related_
person_result
[
0
]
related_
login_result
=
self
.
portal
.
portal_catalog
(
portal_type
=
'ERP5 Login'
,
reference
=
'homie'
)
self
.
assertEqual
(
len
(
related_
logi
n_result
),
1
)
related_person
=
related_
login_result
[
0
].
getParentValue
()
self
.
assertEqual
(
related_person
.
getLastName
(),
'Simpsons'
)
self
.
assertEqual
(
related_person
.
getDefaultEmailText
(),
'homie.simpsons@fox.com'
)
...
...
@@ -609,7 +607,7 @@ class TestERP5Credential(ERP5TypeTestCase):
sequence
.
edit
(
barney
=
person
)
# check barney can log in the system
self
.
_assertUserExists
(
'barney-login'
,
'secret'
)
self
.
login
(
'barney
'
)
self
.
login
ByUserName
(
'barney-login
'
)
from
AccessControl
import
getSecurityManager
self
.
assertEqual
(
getSecurityManager
().
getUser
().
getIdOrUserName
(),
person
.
Person_getUserId
())
...
...
@@ -658,10 +656,10 @@ class TestERP5Credential(ERP5TypeTestCase):
self
.
portal
.
ERP5Site_newCredentialRecovery
(
default_email_text
=
default_email_text
)
def
stepLoginAsCurrent
Perso
nReference
(
self
,
sequence
=
None
,
def
stepLoginAsCurrent
Logi
nReference
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
person_reference
=
sequence
[
"perso
n_reference"
]
self
.
login
(
perso
n_reference
)
login_reference
=
sequence
[
"logi
n_reference"
]
self
.
login
ByUserName
(
logi
n_reference
)
def
stepCreateCredentialUpdateWithERP5Site_newCredentialUpdate
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
...
...
@@ -863,8 +861,7 @@ class TestERP5Credential(ERP5TypeTestCase):
def
stepCheckPersonAfterSubscriptionRequest
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
self
.
login
()
person
=
self
.
portal
.
portal_catalog
.
getResultValue
(
reference
=
sequence
[
"person_reference"
],
portal_type
=
"Person"
)
person
=
self
.
portal
.
acl_users
.
getUser
(
sequence
[
'login_reference'
]).
getUserValue
()
self
.
assertEqual
(
"Homer"
,
person
.
getFirstName
())
self
.
assertEqual
(
"Simpson"
,
person
.
getLastName
())
self
.
assertEqual
(
"homer.simpson@fox.com"
,
person
.
getDefaultEmailText
())
...
...
@@ -873,16 +870,14 @@ class TestERP5Credential(ERP5TypeTestCase):
def
stepSetAuditorRoleToCurrentPerson
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
person_reference
=
sequence
[
"person_reference"
]
self
.
login
()
person
=
self
.
portal
.
acl_users
.
getUser
(
person_reference
).
getUserValue
()
person
=
self
.
portal
.
acl_users
.
getUser
(
sequence
[
'login_reference'
]
).
getUserValue
()
person
.
manage_setLocalRoles
(
person
.
Person_getUserId
(),
[
"Auditor"
])
self
.
logout
()
def
stepCheckPersonAfterUpdatePerson
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
person
=
self
.
portal
.
portal_catalog
.
getResultValue
(
reference
=
sequence
[
"person_reference"
],
portal_type
=
"Person"
)
person
=
self
.
portal
.
acl_users
.
getUser
(
sequence
[
'login_reference'
]).
getUserValue
()
self
.
assertEqual
(
"tom"
,
person
.
getFirstName
())
self
.
assertEqual
(
"Simpson"
,
person
.
getLastName
())
self
.
assertEqual
(
"tom@host.com"
,
person
.
getDefaultEmailText
())
...
...
@@ -1123,8 +1118,7 @@ class TestERP5Credential(ERP5TypeTestCase):
self.portal.ERP5Site_activeLogin(mail_message.getReference())
self.login()
self.tic()
person = portal_catalog.getResultValue(reference="
barney
",
portal_type="
Person
")
person = self.portal.acl_users.getUser('barney').getUserValue()
assignment_list = person.objectValues(portal_type="
Assignment
")
self.assertNotEquals(assignment_list, [])
self.assertEqual(len(assignment_list), 1)
...
...
@@ -1233,7 +1227,7 @@ class TestERP5Credential(ERP5TypeTestCase):
"
stepCheckPersonAfterSubscriptionRequest
"
\
"
SetAuditorRoleToCurrentPerson
"
\
"
SetAssigneeRoleToCurrentPersonInCredentialUpdateModule
Tic
"
\
"
LoginAsCurrent
Perso
nReference
"
\
"
LoginAsCurrent
Logi
nReference
"
\
"
CreateCredentialUpdateWithERP5Site_newCredentialUpdate
Tic
"
\
"
SelectCredentialUpdate
"
\
"
AcceptCredentialUpdate
Tic
"
\
...
...
@@ -1296,7 +1290,7 @@ class TestERP5Credential(ERP5TypeTestCase):
'''
sequence_list = SequenceList()
sequence_string = "
CreatePersonWithQuestionUsingCamelCase
Tic
"
\
"
LoginAsCurrent
Perso
nReference
"
\
"
LoginAsCurrent
Logi
nReference
"
\
"
CreateCredentialRecoveryWithSensitiveAnswer
Tic
"
\
"
AcceptCredentialRecovery
Tic
"
\
"
CheckEmailIsSent
Tic
"
\
...
...
product/ERP5/tests/testPasswordTool.py
View file @
82235674
This diff is collapsed.
Click to expand it.
product/ERP5/tests/testWorklist.py
View file @
82235674
...
...
@@ -117,6 +117,7 @@ class TestWorklist(ERP5TypeTestCase):
stop_date
=
'01/01/2900'
,
)
assignment
.
open
()
person
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
user_login
).
validate
()
# Reindexing is required for the security to work
self
.
tic
()
...
...
product/ERP5Banking/tests/TestERP5BankingMixin.py
View file @
82235674
...
...
@@ -150,6 +150,10 @@ class TestERP5BankingMixin(ERP5TypeTestCase):
# by the assignment workflow when NuxUserGroup is used and
# by ERP5Security PAS plugins in the context of PAS use.
assignment
.
open
()
person
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
user_login
,
).
validate
()
if
self
.
PAS_installed
:
# reindexing is required for the security to work
...
...
product/ERP5Catalog/tests/testERP5CatalogSecurityUidOptimization.py
View file @
82235674
...
...
@@ -128,6 +128,7 @@ CREATE TABLE alternate_roles_and_users (
reference
=
'user1'
)
user1_id
=
user1
.
Person_getUserId
()
user1
.
newContent
(
portal_type
=
'Assignment'
,
group
=
'g1'
).
open
()
user1
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
'user1'
).
validate
()
user1
.
updateLocalRolesOnSecurityGroups
()
self
.
assertEqual
(
user1
.
__ac_local_roles__
.
get
(
user1_id
),
[
'Auditor'
])
self
.
assertEqual
(
user1
.
__ac_local_roles__
.
get
(
'GROUP1'
),
[
'Unknown'
])
...
...
@@ -136,6 +137,7 @@ CREATE TABLE alternate_roles_and_users (
reference
=
'user2'
)
user2_id
=
user2
.
Person_getUserId
()
user2
.
newContent
(
portal_type
=
'Assignment'
,
group
=
'g1'
).
open
()
user2
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
'user2'
).
validate
()
user2
.
updateLocalRolesOnSecurityGroups
()
self
.
assertEqual
(
user2
.
__ac_local_roles__
.
get
(
user2_id
),
[
'Auditor'
])
self
.
assertEqual
(
user2
.
__ac_local_roles__
.
get
(
'GROUP1'
),
[
'Unknown'
])
...
...
product/ERP5Form/tests/testGUIwithSecurity.py
View file @
82235674
...
...
@@ -72,6 +72,7 @@ class TestGUISecurity(ERP5TypeTestCase):
self
.
assertTrue
(
'Created Successfully'
in
message
)
if
not
hasattr
(
portal
.
person_module
,
'user'
):
user
=
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
id
=
'user'
,
reference
=
'user'
)
user
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
'user'
).
validate
()
asg
=
user
.
newContent
(
portal_type
=
'Assignment'
)
asg
.
setStartDate
(
DateTime
()
-
100
)
asg
.
setStopDate
(
DateTime
()
+
100
)
...
...
product/ERP5OOo/tests/testDeferredStyle.py
View file @
82235674
...
...
@@ -64,10 +64,15 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
person
=
person_module
.
newContent
(
id
=
'pers'
,
portal_type
=
'Person'
,
reference
=
self
.
username
,
first_name
=
self
.
first_name
,
password
=
self
.
password
,
default_email_text
=
self
.
recipient_email_address
)
assignment
=
person
.
newContent
(
portal_type
=
'Assignment'
)
assignment
.
open
()
login
=
person
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
self
.
username
,
password
=
self
.
password
,
)
login
.
validate
()
self
.
tic
()
def
loginAsUser
(
self
,
username
):
...
...
product/ERP5Security/tests/testERP5Security.py
View file @
82235674
This diff is collapsed.
Click to expand it.
product/ERP5Type/tests/ERP5TypeTestCase.py
View file @
82235674
...
...
@@ -471,8 +471,11 @@ class ERP5TypeTestCaseMixin(ProcessingNodeTestCase, PortalTestCase):
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
reference
=
reference
,
password
=
password
,
**
person_kw
)
login
=
person
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
reference
,
password
=
password
)
login
.
validate
()
return
person
def
createUserAssignment
(
self
,
user
,
assignment_kw
):
...
...
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