Commit aabccc4f authored by Gabriel Monnerat's avatar Gabriel Monnerat

add test and steps to check that using the script...

add test and steps to check that using the script ERP5Site_newCredentialRecovery and passing the default_email_text, the Crendential Recovery is not created with destination decision empty
parent 88126dcd
...@@ -554,7 +554,8 @@ class TestERP5Credential(ERP5TypeTestCase): ...@@ -554,7 +554,8 @@ class TestERP5Credential(ERP5TypeTestCase):
assignment = person.newContent(portal_type='Assignment', assignment = person.newContent(portal_type='Assignment',
function='member') function='member')
assignment.open() assignment.open()
sequence.edit(person_reference=person.getReference()) sequence.edit(person_reference=person.getReference(),
default_email_text=person.getDefaultEmailText())
def stepCreateSameEmailPersonList(self, sequence=None, sequence_list=None, def stepCreateSameEmailPersonList(self, sequence=None, sequence_list=None,
**kw): **kw):
...@@ -636,6 +637,12 @@ class TestERP5Credential(ERP5TypeTestCase): ...@@ -636,6 +637,12 @@ class TestERP5Credential(ERP5TypeTestCase):
person_reference = sequence["person_reference"] person_reference = sequence["person_reference"]
self.portal.ERP5Site_newCredentialRecovery(reference=person_reference) self.portal.ERP5Site_newCredentialRecovery(reference=person_reference)
def stepRequestCredentialRecoveryWithERP5Site_newCredentialRecoveryByEmail(
self, sequence=None, sequence_list=None, **kw):
default_email_text = sequence["default_email_text"]
self.portal.ERP5Site_newCredentialRecovery(
default_email_text=default_email_text)
def stepLoginAsCurrentPersonReference(self, sequence=None, def stepLoginAsCurrentPersonReference(self, sequence=None,
sequence_list=None, **kw): sequence_list=None, **kw):
person_reference = sequence["person_reference"] person_reference = sequence["person_reference"]
...@@ -862,6 +869,12 @@ class TestERP5Credential(ERP5TypeTestCase): ...@@ -862,6 +869,12 @@ class TestERP5Credential(ERP5TypeTestCase):
reference=sequence["person_reference"], portal_type="Person") reference=sequence["person_reference"], portal_type="Person")
self.assertEquals("Barney", person.getFirstName()) self.assertEquals("Barney", person.getFirstName())
def stepCheckCredentialRecoveryNotEmptyDestinationDecision(self, sequence):
credential_recovery = self.portal.portal_catalog.getResultValue(
portal_type="Credential Recovery", sort_on=(("creation_date", "DESC"),),
validation_state="submitted")
self.assertNotEquals(None, credential_recovery.getDestinationDecisionValue())
def test_01_simpleSubscriptionRequest(self): def test_01_simpleSubscriptionRequest(self):
''' '''
Check that is possible to subscribe to erp5 Check that is possible to subscribe to erp5
...@@ -1325,6 +1338,19 @@ class TestERP5Credential(ERP5TypeTestCase): ...@@ -1325,6 +1338,19 @@ class TestERP5Credential(ERP5TypeTestCase):
self.assertFalse('Contract' in result) self.assertFalse('Contract' in result)
self.assertFalse('your_term_confirmation' in result) self.assertFalse('your_term_confirmation' in result)
def test_ERP5Site_newCredentialRecovery_using_default_email_text(self):
"""
Check that using the script ERP5Site_newCredentialRecovery and passing
the default_email_text, the login is recover correctly
"""
sequence_list = SequenceList()
sequence_string = "CreatePerson Tic " \
"RequestCredentialRecoveryWithERP5Site_newCredentialRecoveryByEmail Tic " \
"CheckCredentialRecoveryNotEmptyDestinationDecision"
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestERP5Credential)) suite.addTest(unittest.makeSuite(TestERP5Credential))
......
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