Commit 7c2d43d5 authored by Łukasz Nowak's avatar Łukasz Nowak

Check availaibility in script too.

CredentialRequest_checkLoginAvailability was used only on form, but script
shall not trust that form correctly validated everything, so recheck here too.
parent b5b6c277
......@@ -59,6 +59,11 @@ module = context.getDefaultModule(portal_type=\'Credential Request\')\n
portal_preferences = context.portal_preferences\n
category_list = portal_preferences.getPreferredSubscriptionAssignmentCategoryList()\n
\n
if not context.CredentialRequest_checkLoginAvailability(reference):\n
message_str = "Selected login is already in use, please choose different one."\n
return context.Base_redirect(dialog_id,\n
keep_items = dict(portal_status_message=context.Base_translateString(message_str)))\n
\n
credential_request = module.newContent(\n
\t\tportal_type="Credential Request",\n
first_name=first_name,\n
......
......@@ -1018,7 +1018,7 @@ class TestERP5Credential(ERP5TypeTestCase):
Check that the script ERP5Site_newCredentialRequest will create one
Credential Request correctly
"""
sequence = dict(automatic_call=False)
sequence = dict(automatic_call=True)
self.stepSetCredentialRequestAutomaticApprovalPreferences(sequence)
self.stepSetCredentialAssignmentPropertyList()
self._createCredentialRequest()
......@@ -1031,7 +1031,6 @@ class TestERP5Credential(ERP5TypeTestCase):
self.assertEquals(credential_request.getRole(), "internal")
self.assertEquals(credential_request.getFunction(), "member")
credential_request.submit()
self.portal.portal_alarms.accept_submitted_credentials.activeSense()
transaction.commit()
self.tic()
......@@ -1042,7 +1041,6 @@ class TestERP5Credential(ERP5TypeTestCase):
portal_type="Credential Request", reference="barney",
validation_state="draft")
credential_request.submit()
self.portal.portal_alarms.accept_submitted_credentials.activeSense()
transaction.commit()
self.tic()
......
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