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
Papa Tamsir Kane
erp5
Commits
f76f3f90
Commit
f76f3f90
authored
Jun 19, 2011
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve tests to validate the modifications of
f01d4dcb
parent
ab887735
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
16 deletions
+40
-16
product/ERP5/tests/testERP5Credential.py
product/ERP5/tests/testERP5Credential.py
+40
-16
No files found.
product/ERP5/tests/testERP5Credential.py
View file @
f76f3f90
...
@@ -235,14 +235,23 @@ class TestERP5Credential(ERP5TypeTestCase):
...
@@ -235,14 +235,23 @@ class TestERP5Credential(ERP5TypeTestCase):
self
.
tic
()
self
.
tic
()
self
.
logout
()
self
.
logout
()
def
stepSetCredentialRequestAutomaticApprovalPreferences
(
self
,
sequence
=
None
,
def
stepSetCredentialRequestAutomaticApprovalPreferences
(
self
,
sequence
=
None
):
sequence_list
=
None
,
**
kw
):
self
.
login
()
self
.
login
()
preference
=
self
.
_getPreference
()
preference
=
self
.
_getPreference
()
preference
.
edit
(
preferred_credential_request_automatic_approval
=
True
)
preference
.
edit
(
preferred_credential_request_automatic_approval
=
True
)
self
.
_enablePreference
()
self
.
_enablePreference
()
transaction
.
commit
()
self
.
stepTic
()
self
.
tic
()
self
.
logout
()
def
stepSetCredentialAssignmentPropertyList
(
self
,
sequence
=
{}):
role_list
=
sequence
.
get
(
"role_list"
,
[
"internal"
,])
function_list
=
sequence
.
get
(
"function_list"
,
[
"member"
,])
self
.
login
()
preference
=
self
.
_getPreference
()
preference
.
edit
(
preferred_credential_assignment_role_list
=
role_list
,
preferred_credential_assignment_function_list
=
function_list
)
self
.
_enablePreference
()
self
.
stepTic
()
self
.
logout
()
self
.
logout
()
def
stepSetOrganisationCredentialUpdateAutomaticApprovalPreferences
(
self
,
sequence
=
None
,
def
stepSetOrganisationCredentialUpdateAutomaticApprovalPreferences
(
self
,
sequence
=
None
,
...
@@ -720,8 +729,7 @@ class TestERP5Credential(ERP5TypeTestCase):
...
@@ -720,8 +729,7 @@ class TestERP5Credential(ERP5TypeTestCase):
last_name
=
"Monnerat"
,
last_name
=
"Monnerat"
,
reference
=
"gabriel"
,
reference
=
"gabriel"
,
password
=
"123"
,
password
=
"123"
,
default_email_text
=
"gabriel@test.com"
,
default_email_text
=
"gabriel@test.com"
):
role
=
"client"
):
self
.
logout
()
self
.
logout
()
self
.
portal
.
ERP5Site_registerCredentialRequest
(
first_name
=
first_name
,
self
.
portal
.
ERP5Site_registerCredentialRequest
(
first_name
=
first_name
,
last_name
=
last_name
,
last_name
=
last_name
,
...
@@ -732,8 +740,7 @@ class TestERP5Credential(ERP5TypeTestCase):
...
@@ -732,8 +740,7 @@ class TestERP5Credential(ERP5TypeTestCase):
default_telephone_text
=
"223344"
,
default_telephone_text
=
"223344"
,
default_address_street_address
=
"Test Street"
,
default_address_street_address
=
"Test Street"
,
default_address_city
=
"Campos"
,
default_address_city
=
"Campos"
,
default_address_zip_code
=
"28024030"
,
default_address_zip_code
=
"28024030"
)
role
=
role
)
self
.
login
(
"ERP5TypeTestCase"
)
self
.
login
(
"ERP5TypeTestCase"
)
self
.
stepTic
()
self
.
stepTic
()
...
@@ -823,29 +830,46 @@ class TestERP5Credential(ERP5TypeTestCase):
...
@@ -823,29 +830,46 @@ class TestERP5Credential(ERP5TypeTestCase):
self.assertEquals(credential_request.getDefaultEmailText(), "
gabriel
@
test
.
com
")
self.assertEquals(credential_request.getDefaultEmailText(), "
gabriel
@
test
.
com
")
self.stepUnSetCredentialAutomaticApprovalPreferences()
self.stepUnSetCredentialAutomaticApprovalPreferences()
def test
Overwrite
Base_getDefaultAssignmentArgumentDict(self):
def testBase_getDefaultAssignmentArgumentDict(self):
portal_catalog = self.portal.portal_catalog
portal_catalog = self.portal.portal_catalog
portal_skins = self.getSkinsTool()
script = portal_skins.erp5_credential.Base_getDefaultAssignmentArgumentDict
self.login("
ERP5TypeTestCase
")
script.ZPythonScript_edit("
**
kw
",
"
return
dict
(
role_list
=
[
'internal'
,],
function_list
=
[
'member'
,])
")
self.logout()
self.stepSetCredentialRequestAutomaticApprovalPreferences()
self.stepSetCredentialRequestAutomaticApprovalPreferences()
self._createCredentialRequest(role=None)
self.stepSetCredentialAssignmentPropertyList()
self._createCredentialRequest()
credential_request = portal_catalog.getResultValue(portal_type="
Credential
Request
",
credential_request = portal_catalog.getResultValue(portal_type="
Credential
Request
",
reference="
gabriel
")
reference="
gabriel
")
mail_message = portal_catalog.getResultValue(portal_type="
Mail
Message
",
mail_message = portal_catalog.getResultValue(portal_type="
Mail
Message
",
follow_up=credential_request)
follow_up=credential_request)
self.stepTic()
self.logout()
self.logout()
self.portal.ERP5Site_activeLogin(mail_message.getReference())
self.portal.ERP5Site_activeLogin(mail_message.getReference())
self.login("
ERP5TypeTestCase
")
self.login("
ERP5TypeTestCase
")
self.stepTic()
self.stepTic()
person = portal_catalog.getResultValue(reference="
gabriel
", portal_type="
Person
")
person = portal_catalog.getResultValue(reference="
gabriel
", portal_type="
Person
")
assignment_list = person.objectValues(portal_type="
Assignment
")
assignment_list = person.objectValues(portal_type="
Assignment
")
self.assertEquals(len(assignment_list), 1)
assignment = assignment_list[0]
assignment = assignment_list[0]
self.assertEquals(assignment.getFunction(), "
member
")
self.assertEquals(assignment.getFunction(), "
member
")
self.assertEquals(assignment.getRole(), "
internal
")
self.assertEquals(assignment.getRole(), "
internal
")
self.stepSetCredentialAssignmentPropertyList(dict(role_list=["
client
",],
function_list=["
agent
"]))
self._createCredentialRequest(reference="
credential_user
")
credential_request = portal_catalog.getResultValue(portal_type="
Credential
Request
",
reference="
credential_user
")
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="
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