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
Paul Graydon
erp5
Commits
dcbf1519
Commit
dcbf1519
authored
Mar 24, 2023
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Security: Add tests for login with an user on the same transaction
that it was created.
parent
ce2eaca9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
product/ERP5Security/tests/testERP5Security.py
product/ERP5Security/tests/testERP5Security.py
+16
-2
No files found.
product/ERP5Security/tests/testERP5Security.py
View file @
dcbf1519
...
...
@@ -76,10 +76,10 @@ class UserManagementTestCase(ERP5TypeTestCase):
def
getUserFolder
(
self
):
"""Returns the acl_users. """
return
self
.
getPortal
()
.
acl_users
return
self
.
portal
.
acl_users
def
loginAsUser
(
self
,
username
):
uf
=
self
.
portal
.
acl_users
uf
=
self
.
getUserFolder
()
user
=
uf
.
getUserById
(
username
).
__of__
(
uf
)
newSecurityManager
(
None
,
user
)
...
...
@@ -456,6 +456,20 @@ class TestUserManagement(UserManagementTestCase):
self
.
tic
()
self
.
assertEqual
(
None
,
person
.
Person_getUserId
())
def
test_DeletedPersonIsNotUser
(
self
):
user_id
,
login
,
password
=
self
.
_makePerson
()
self
.
_assertUserExists
(
login
,
password
)
acl_user
,
=
self
.
portal
.
acl_users
.
searchUsers
(
id
=
user_id
,
exact_match
=
True
)
self
.
portal
.
restrictedTraverse
(
acl_user
[
'path'
]).
delete
()
self
.
commit
()
self
.
_assertUserDoesNotExists
(
login
,
password
)
def
test_UnindexedPersonIsNotUser
(
self
):
user_id
,
login
,
password
=
self
.
_makePerson
(
tic
=
False
)
self
.
_assertUserDoesNotExists
(
login
,
password
)
self
.
tic
()
self
.
_assertUserExists
(
login
,
password
)
class
DuplicatePrevention
(
UserManagementTestCase
):
def
test_MultipleUsers
(
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