Commit 0a542126 authored by Gabriel Monnerat's avatar Gabriel Monnerat

update tests to follow last changes in erp5_credential. The changes were:...

update tests to follow last changes in erp5_credential. The changes were: 57e6dbf6, ee9adc59, 8ac9c40f
parent 57e6dbf6
...@@ -229,7 +229,9 @@ class TestERP5Credential(ERP5TypeTestCase): ...@@ -229,7 +229,9 @@ class TestERP5Credential(ERP5TypeTestCase):
preference.edit(preferred_credential_request_automatic_approval=False, preference.edit(preferred_credential_request_automatic_approval=False,
preferred_credential_recovery_automatic_approval=False, preferred_credential_recovery_automatic_approval=False,
preferred_organisation_credential_update_automatic_approval=False, preferred_organisation_credential_update_automatic_approval=False,
preferred_person_credential_update_automatic_approval=False) preferred_person_credential_update_automatic_approval=False,
preferred_credential_alarm_automatic_call=True)
self._enablePreference() self._enablePreference()
transaction.commit() transaction.commit()
self.tic() self.tic()
...@@ -238,7 +240,9 @@ class TestERP5Credential(ERP5TypeTestCase): ...@@ -238,7 +240,9 @@ class TestERP5Credential(ERP5TypeTestCase):
def stepSetCredentialRequestAutomaticApprovalPreferences(self, sequence=None): def stepSetCredentialRequestAutomaticApprovalPreferences(self, sequence=None):
self.login() self.login()
preference = self._getPreference() preference = self._getPreference()
preference.edit(preferred_credential_request_automatic_approval=True) automatic_call = sequence.get("automatic_call", True)
preference.edit(preferred_credential_request_automatic_approval=True,
preferred_credential_alarm_automatic_call=automatic_call)
self._enablePreference() self._enablePreference()
self.stepTic() self.stepTic()
self.logout() self.logout()
...@@ -752,7 +756,7 @@ class TestERP5Credential(ERP5TypeTestCase): ...@@ -752,7 +756,7 @@ class TestERP5Credential(ERP5TypeTestCase):
password="123", password="123",
default_email_text="gabriel@test.com"): default_email_text="gabriel@test.com"):
self.logout() self.logout()
self.portal.ERP5Site_registerCredentialRequest(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,
...@@ -782,10 +786,14 @@ class TestERP5Credential(ERP5TypeTestCase): ...@@ -782,10 +786,14 @@ class TestERP5Credential(ERP5TypeTestCase):
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):
sequence.edit(automatic_call=False)
def testMailMessagePosted(self): def testMailMessagePosted(self):
""" Test if the Mail Message was posted correctly """ """ Test if the Mail Message was posted correctly """
sequence_list = SequenceList() sequence_list = SequenceList()
sequence_string = 'stepSetCredentialRequestAutomaticApprovalPreferences '\ sequence_string = 'SetCredentialRequestAutomaticApprovalPreferences '\
'SetPreferredCredentialAlarmAutomaticCallAsFalse '\
'CreateCredentialRequestSample '\ 'CreateCredentialRequestSample '\
'CheckIfMailMessageWasPosted '\ 'CheckIfMailMessageWasPosted '\
'stepUnSetCredentialAutomaticApprovalPreferences'\ 'stepUnSetCredentialAutomaticApprovalPreferences'\
...@@ -795,7 +803,8 @@ class TestERP5Credential(ERP5TypeTestCase): ...@@ -795,7 +803,8 @@ class TestERP5Credential(ERP5TypeTestCase):
def testMailFromMailMessageEvent(self): def testMailFromMailMessageEvent(self):
""" """ """ """
self.stepSetCredentialRequestAutomaticApprovalPreferences() sequence = dict(automatic_call=False)
self.stepSetCredentialRequestAutomaticApprovalPreferences(sequence)
self._createCredentialRequest(first_name="Vifib", self._createCredentialRequest(first_name="Vifib",
last_name="Test", last_name="Test",
reference="vifibtest") reference="vifibtest")
...@@ -819,7 +828,8 @@ class TestERP5Credential(ERP5TypeTestCase): ...@@ -819,7 +828,8 @@ class TestERP5Credential(ERP5TypeTestCase):
def testERP5Site_activeLogin(self): def testERP5Site_activeLogin(self):
""" Test if the script WebSection_activeLogin will create one user """ Test if the script WebSection_activeLogin will create one user
correctly """ correctly """
self.stepSetCredentialRequestAutomaticApprovalPreferences() sequence = dict(automatic_call=False)
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(portal_type="Credential Request",
...@@ -839,10 +849,11 @@ class TestERP5Credential(ERP5TypeTestCase): ...@@ -839,10 +849,11 @@ class TestERP5Credential(ERP5TypeTestCase):
self.assertEquals(person.getValidationState(), "validated") self.assertEquals(person.getValidationState(), "validated")
self.stepUnSetCredentialAutomaticApprovalPreferences() self.stepUnSetCredentialAutomaticApprovalPreferences()
def testERP5Site_registerCredentialRequest(self): def testERP5Site_newCredentialRequest(self):
""" Test if the script ERP5Site_registerCredentialRequest will create one """ Test if the script ERP5Site_newCredentialRequest will create one
Credential Request correctly """ Credential Request correctly """
self.stepSetCredentialRequestAutomaticApprovalPreferences() sequence = dict(automatic_call=False)
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(portal_type="Credential Request",
...@@ -853,7 +864,8 @@ class TestERP5Credential(ERP5TypeTestCase): ...@@ -853,7 +864,8 @@ class TestERP5Credential(ERP5TypeTestCase):
def testBase_getDefaultAssignmentArgumentDict(self): def testBase_getDefaultAssignmentArgumentDict(self):
self.stepSetCredentialRequestAutomaticApprovalPreferences() sequence = dict(automatic_call=False)
self.stepSetCredentialRequestAutomaticApprovalPreferences(sequence)
self.stepSetCredentialAssignmentPropertyList() self.stepSetCredentialAssignmentPropertyList()
self._createCredentialRequest() self._createCredentialRequest()
sequence = dict(reference="gabriel", sequence = dict(reference="gabriel",
......
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