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
Thomas Gambier
erp5
Commits
51305e53
Commit
51305e53
authored
Jun 19, 2011
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove code duplicated
parent
f76f3f90
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
34 deletions
+32
-34
product/ERP5/tests/testERP5Credential.py
product/ERP5/tests/testERP5Credential.py
+32
-34
No files found.
product/ERP5/tests/testERP5Credential.py
View file @
51305e53
...
@@ -284,6 +284,28 @@ class TestERP5Credential(ERP5TypeTestCase):
...
@@ -284,6 +284,28 @@ class TestERP5Credential(ERP5TypeTestCase):
self
.
tic
()
self
.
tic
()
self
.
logout
()
self
.
logout
()
def
stepCheckAssignmentAfterActiveLogin
(
self
,
sequence
):
portal_catalog
=
self
.
portal
.
portal_catalog
reference
=
sequence
[
"reference"
]
assignment_function
=
sequence
[
"assignment_function"
]
assignment_role
=
sequence
[
"assignment_role"
]
credential_request
=
portal_catalog
.
getResultValue
(
portal_type
=
"Credential Request"
,
reference
=
reference
)
mail_message
=
portal_catalog
.
getResultValue
(
portal_type
=
"Mail Message"
,
follow_up
=
credential_request
)
self
.
stepTic
()
self
.
logout
()
self
.
portal
.
ERP5Site_activeLogin
(
mail_message
.
getReference
())
self
.
login
(
"ERP5TypeTestCase"
)
self
.
stepTic
()
person
=
portal_catalog
.
getResultValue
(
reference
=
reference
,
portal_type
=
"Person"
)
assignment_list
=
person
.
objectValues
(
portal_type
=
"Assignment"
)
self
.
assertEquals
(
len
(
assignment_list
),
1
)
assignment
=
assignment_list
[
0
]
self
.
assertEquals
(
assignment
.
getFunction
(),
assignment_function
)
self
.
assertEquals
(
assignment
.
getRole
(),
assignment_role
)
def
getUserFolder
(
self
):
def
getUserFolder
(
self
):
"""Returns the acl_users. """
"""Returns the acl_users. """
return
self
.
getPortal
().
acl_users
return
self
.
getPortal
().
acl_users
...
@@ -830,46 +852,22 @@ class TestERP5Credential(ERP5TypeTestCase):
...
@@ -830,46 +852,22 @@ class TestERP5Credential(ERP5TypeTestCase):
self.assertEquals(credential_request.getDefaultEmailText(), "
gabriel
@
test
.
com
")
self.assertEquals(credential_request.getDefaultEmailText(), "
gabriel
@
test
.
com
")
self.stepUnSetCredentialAutomaticApprovalPreferences()
self.stepUnSetCredentialAutomaticApprovalPreferences()
def testBase_getDefaultAssignmentArgumentDict(self):
def testBase_getDefaultAssignmentArgumentDict(self):
portal_catalog = self.portal.portal_catalog
self.stepSetCredentialRequestAutomaticApprovalPreferences()
self.stepSetCredentialRequestAutomaticApprovalPreferences()
self.stepSetCredentialAssignmentPropertyList()
self.stepSetCredentialAssignmentPropertyList()
self._createCredentialRequest()
self._createCredentialRequest()
credential_request = portal_catalog.getResultValue(portal_type="
Credential
Request
",
sequence = dict(reference="
gabriel
",
reference="
gabriel
")
assignment_function="
member
",
mail_message = portal_catalog.getResultValue(portal_type="
Mail
Message
",
assignment_role="
internal
")
follow_up=credential_request)
self.stepCheckAssignmentAfterActiveLogin(sequence)
self.stepTic()
self.logout()
self.portal.ERP5Site_activeLogin(mail_message.getReference())
self.login("
ERP5TypeTestCase
")
self.stepTic()
person = portal_catalog.getResultValue(reference="
gabriel
", portal_type="
Person
")
assignment_list = person.objectValues(portal_type="
Assignment
")
self.assertEquals(len(assignment_list), 1)
assignment = assignment_list[0]
self.assertEquals(assignment.getFunction(), "
member
")
self.assertEquals(assignment.getRole(), "
internal
")
self.stepSetCredentialAssignmentPropertyList(dict(role_list=["
client
",],
self.stepSetCredentialAssignmentPropertyList(dict(role_list=["
client
",],
function_list=["
agent
"]))
function_list=["
agent
"
,
]))
self._createCredentialRequest(reference="
credential_user
")
self._createCredentialRequest(reference="
credential_user
")
credential_request = portal_catalog.getResultValue(portal_type="
Credential
Request
",
sequence = dict(reference="
credential_user
",
reference="
credential_user
")
assignment_function="
agent
",
mail_message = portal_catalog.getResultValue(portal_type="
Mail
Message
",
assignment_role="
client
")
follow_up=credential_request)
self.stepCheckAssignmentAfterActiveLogin(sequence)
self.stepTic()
self.logout()
self.portal.ERP5Site_activeLogin(mail_message.getReference())
self.login("
ERP5TypeTestCase
")
self.stepTic()
person = portal_catalog.getResultValue(reference="
credential_user
",
portal_type="
Person
")
assignment_list = person.objectValues(portal_type="
Assignment
")
self.assertEquals(len(assignment_list), 1)
assignment = assignment_list[0]
self.assertEquals(assignment.getFunction(), "
agent
")
self.assertEquals(assignment.getRole(), "
client
")
def test_xx_checkCredentialQuestionIsNotCaseSensitive(self):
def test_xx_checkCredentialQuestionIsNotCaseSensitive(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