Commit d897db84 authored by Gabriel Monnerat's avatar Gabriel Monnerat

refactor to avoid more then 79 characters in a line

parent 0a542126
...@@ -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",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment