Commit c8e0b8ad authored by Jérome Perrin's avatar Jérome Perrin

test: update tests related to login consistency checks

Login consistency is only checked when we call validate_action.
parent 1d3c57d0
...@@ -119,11 +119,13 @@ class TestUserManagement(ERP5TypeTestCase): ...@@ -119,11 +119,13 @@ class TestUserManagement(ERP5TypeTestCase):
if login is not None: if login is not None:
if login is AUTO_LOGIN: if login is AUTO_LOGIN:
login = 'login_%s' % self._login_generator() login = 'login_%s' % self._login_generator()
new_person.newContent( login_document = new_person.newContent(
portal_type='ERP5 Login', portal_type='ERP5 Login',
reference=login, reference=login,
password=password, password=password,
).validate() )
# we execute user action transition to make sure validation checks are performed.
self.portal.portal_workflow.doActionFor(login_document, 'validate_action')
if tic: if tic:
self.tic() self.tic()
return new_person.Person_getUserId(), login, password return new_person.Person_getUserId(), login, password
...@@ -243,7 +245,6 @@ class TestUserManagement(ERP5TypeTestCase): ...@@ -243,7 +245,6 @@ class TestUserManagement(ERP5TypeTestCase):
login_value.invalidate() login_value.invalidate()
login_value.setReference('') login_value.setReference('')
self.commit() self.commit()
self.assertRaises(ValidationFailed, login_value.validate)
self.assertRaises(ValidationFailed, self.portal.portal_workflow.doActionFor, login_value, 'validate_action') self.assertRaises(ValidationFailed, self.portal.portal_workflow.doActionFor, login_value, 'validate_action')
def test_PersonWithLoginWithNotAssignmentAreNotUsers(self): def test_PersonWithLoginWithNotAssignmentAreNotUsers(self):
...@@ -570,7 +571,6 @@ class TestUserManagement(ERP5TypeTestCase): ...@@ -570,7 +571,6 @@ class TestUserManagement(ERP5TypeTestCase):
login2_value.invalidate() login2_value.invalidate()
login2_value.setReference(login1) login2_value.setReference(login1)
self.commit() self.commit()
self.assertRaises(ValidationFailed, login2_value.validate)
self.assertRaises(ValidationFailed, self.portal.portal_workflow.doActionFor, login2_value, 'validate_action') self.assertRaises(ValidationFailed, self.portal.portal_workflow.doActionFor, login2_value, 'validate_action')
def _duplicateLoginReference(self, commit): def _duplicateLoginReference(self, commit):
......
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