Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
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
Hamza
erp5-Boxiang
Commits
d897db84
Commit
d897db84
authored
Jun 27, 2011
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor to avoid more then 79 characters in a line
parent
0a542126
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
27 deletions
+29
-27
product/ERP5/tests/testERP5Credential.py
product/ERP5/tests/testERP5Credential.py
+29
-27
No files found.
product/ERP5/tests/testERP5Credential.py
View file @
d897db84
...
@@ -757,15 +757,15 @@ class TestERP5Credential(ERP5TypeTestCase):
...
@@ -757,15 +757,15 @@ class TestERP5Credential(ERP5TypeTestCase):
default_email_text
=
"gabriel@test.com"
):
default_email_text
=
"gabriel@test.com"
):
self
.
logout
()
self
.
logout
()
self
.
portal
.
ERP5Site_newCredentialRequest
(
first_name
=
first_name
,
self
.
portal
.
ERP5Site_newCredentialRequest
(
first_name
=
first_name
,
last_name
=
last_name
,
last_name
=
last_name
,
reference
=
reference
,
reference
=
reference
,
password
=
password
,
password
=
password
,
career_subordination_title
=
""
,
career_subordination_title
=
""
,
default_email_text
=
default_email_text
,
default_email_text
=
default_email_text
,
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"
)
self
.
login
(
"ERP5TypeTestCase"
)
self
.
login
(
"ERP5TypeTestCase"
)
self
.
stepTic
()
self
.
stepTic
()
...
@@ -779,12 +779,12 @@ class TestERP5Credential(ERP5TypeTestCase):
...
@@ -779,12 +779,12 @@ class TestERP5Credential(ERP5TypeTestCase):
sequence_list
=
None
,
**
kw
):
sequence_list
=
None
,
**
kw
):
credential_reference_str
=
sequence
[
"credential_reference"
]
credential_reference_str
=
sequence
[
"credential_reference"
]
portal_catalog
=
self
.
portal
.
portal_catalog
portal_catalog
=
self
.
portal
.
portal_catalog
credential_reference
=
portal_catalog
.
getResultValue
(
portal_type
=
"Credential Request"
,
credential_reference
=
portal_catalog
.
getResultValue
(
reference
=
credential_reference_str
)
portal_type
=
"Credential Request"
,
reference
=
credential_reference_str
)
mail_message
=
portal_catalog
.
getResultValue
(
portal_type
=
"Mail Message"
,
mail_message
=
portal_catalog
.
getResultValue
(
portal_type
=
"Mail Message"
,
follow_up
=
credential_reference
)
follow_up
=
credential_reference
)
self
.
assertEquals
(
mail_message
.
getSimulationState
(),
"started"
)
self
.
assertEquals
(
mail_message
.
getSimulationState
(),
"started"
)
self
.
assertTrue
(
"key=%s"
%
mail_message
.
getReference
()
in
mail_message
.
getTextContent
())
self
.
assertTrue
(
"key=%s"
%
mail_message
.
getReference
()
in
mail_message
.
getTextContent
())
def
stepSetPreferredCredentialAlarmAutomaticCallAsFalse
(
self
,
sequence
):
def
stepSetPreferredCredentialAlarmAutomaticCallAsFalse
(
self
,
sequence
):
sequence
.
edit
(
automatic_call
=
False
)
sequence
.
edit
(
automatic_call
=
False
)
...
@@ -809,12 +809,11 @@ class TestERP5Credential(ERP5TypeTestCase):
...
@@ -809,12 +809,11 @@ class TestERP5Credential(ERP5TypeTestCase):
last_name
=
"Test"
,
last_name
=
"Test"
,
reference
=
"vifibtest"
)
reference
=
"vifibtest"
)
portal_catalog
=
self
.
portal
.
portal_catalog
portal_catalog
=
self
.
portal
.
portal_catalog
credential_request
=
portal_catalog
.
getResultValue
(
portal_type
=
"Credential Request"
,
credential_request
=
portal_catalog
.
getResultValue
(
reference
=
"vifibtest"
,
portal_type
=
"Credential Request"
,
reference
=
"vifibtest"
,
first_name
=
"Vifib"
,
first_name
=
"Vifib"
,
last_name
=
"Test"
)
last_name
=
"Test"
)
mail_message
=
portal_catalog
.
getResultValue
(
mail_message
=
portal_catalog
.
getResultValue
(
portal_type
=
"Mail Message"
,
portal_type
=
"Mail Message"
,
follow_up
=
credential_request
)
follow_up
=
credential_request
)
last_message
=
self
.
portal
.
MailHost
.
_last_message
last_message
=
self
.
portal
.
MailHost
.
_last_message
self
.
assertNotEquals
((),
last_message
)
self
.
assertNotEquals
((),
last_message
)
mfrom
,
mto
,
message_text
=
last_message
mfrom
,
mto
,
message_text
=
last_message
...
@@ -822,7 +821,8 @@ class TestERP5Credential(ERP5TypeTestCase):
...
@@ -822,7 +821,8 @@ class TestERP5Credential(ERP5TypeTestCase):
self
.
assertEquals
([
'Vifib Test <gabriel@test.com>'
],
mto
)
self
.
assertEquals
([
'Vifib Test <gabriel@test.com>'
],
mto
)
self
.
assertNotEquals
(
re
.
search
(
"Subject
\
:.*Welcome
"
, message_text), None)
self
.
assertNotEquals
(
re
.
search
(
"Subject
\
:.*Welcome
"
, message_text), None)
self.assertNotEquals(re.search("
Hello
\
Vifib
\
Test
\
,
", message_text), None)
self.assertNotEquals(re.search("
Hello
\
Vifib
\
Test
\
,
", message_text), None)
self.assertNotEquals(re.search("
key
\
=
..
%
s
" % mail_message.getReference(), message_text), None)
self.assertNotEquals(re.search("
key
\
=
..
%
s
" % mail_message.getReference(),
message_text), None)
self.stepUnSetCredentialAutomaticApprovalPreferences()
self.stepUnSetCredentialAutomaticApprovalPreferences()
def testERP5Site_activeLogin(self):
def testERP5Site_activeLogin(self):
...
@@ -832,15 +832,16 @@ class TestERP5Credential(ERP5TypeTestCase):
...
@@ -832,15 +832,16 @@ class TestERP5Credential(ERP5TypeTestCase):
self.stepSetCredentialRequestAutomaticApprovalPreferences(sequence)
self.stepSetCredentialRequestAutomaticApprovalPreferences(sequence)
self._createCredentialRequest()
self._createCredentialRequest()
portal_catalog = self.portal.portal_catalog
portal_catalog = self.portal.portal_catalog
credential_request = portal_catalog.getResultValue(
portal_type="
Credential
Request
",
credential_request = portal_catalog.getResultValue(
reference="
gabriel
")
portal_type="
Credential
Request
",
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.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.assertNotEquals(assignment_list, [])
self.assertNotEquals(assignment_list, [])
self.assertEquals(len(assignment_list), 1)
self.assertEquals(len(assignment_list), 1)
...
@@ -856,13 +857,13 @@ class TestERP5Credential(ERP5TypeTestCase):
...
@@ -856,13 +857,13 @@ class TestERP5Credential(ERP5TypeTestCase):
self.stepSetCredentialRequestAutomaticApprovalPreferences(sequence)
self.stepSetCredentialRequestAutomaticApprovalPreferences(sequence)
self._createCredentialRequest()
self._createCredentialRequest()
portal_catalog = self.portal.portal_catalog
portal_catalog = self.portal.portal_catalog
credential_request = portal_catalog.getResultValue(
portal_type="
Credential
Request
",
credential_request = portal_catalog.getResultValue(
reference="
gabriel
")
portal_type="
Credential
Request
",
reference="
gabriel
")
self.assertEquals(credential_request.getFirstName(), "
Gabriel
")
self.assertEquals(credential_request.getFirstName(), "
Gabriel
")
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):
sequence = dict(automatic_call=False)
sequence = dict(automatic_call=False)
self.stepSetCredentialRequestAutomaticApprovalPreferences(sequence)
self.stepSetCredentialRequestAutomaticApprovalPreferences(sequence)
...
@@ -873,7 +874,8 @@ class TestERP5Credential(ERP5TypeTestCase):
...
@@ -873,7 +874,8 @@ class TestERP5Credential(ERP5TypeTestCase):
assignment_role="
internal
")
assignment_role="
internal
")
self.stepCheckAssignmentAfterActiveLogin(sequence)
self.stepCheckAssignmentAfterActiveLogin(sequence)
category_list = ["
role
/
client
", "
function
/
agent
"]
category_list = ["
role
/
client
", "
function
/
agent
"]
self.stepSetCredentialAssignmentPropertyList(dict(category_list=category_list))
self.stepSetCredentialAssignmentPropertyList(
dict(category_list=category_list))
self._createCredentialRequest(reference="
credential_user
")
self._createCredentialRequest(reference="
credential_user
")
sequence = dict(reference="
credential_user
",
sequence = dict(reference="
credential_user
",
assignment_function="
agent
",
assignment_function="
agent
",
...
...
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