Commit ab72db5a authored by Łukasz Nowak's avatar Łukasz Nowak

Users have to be validated in order to work correctly.

parent dc629e59
...@@ -231,17 +231,22 @@ class testVifibMixin(ERP5TypeTestCase): ...@@ -231,17 +231,22 @@ class testVifibMixin(ERP5TypeTestCase):
if isTransitionPossible(rule, 'validate'): if isTransitionPossible(rule, 'validate'):
rule.validate() rule.validate()
def openAssignments(self): def prepareTestUsers(self):
""" """
Change workflow state of test data imported by the bt5 Prepare test users.
""" """
isTransitionPossible = self.portal.portal_workflow.isTransitionPossible
for person in self.portal.portal_catalog( for person in self.portal.portal_catalog(
portal_type="Person", portal_type="Person",
id="test_%", id="test_%",
): ):
person = person.getObject() person = person.getObject()
if isTransitionPossible(person, 'validate'):
person.validate()
for assignment in person.contentValues(portal_type='Assignment'): for assignment in person.contentValues(portal_type='Assignment'):
assignment.open() if isTransitionPossible(assignment, 'open'):
assignment.open()
def setupVifibMachineAuthenticationPlugin(self): def setupVifibMachineAuthenticationPlugin(self):
"""Sets up Vifib Authentication plugin""" """Sets up Vifib Authentication plugin"""
...@@ -289,7 +294,7 @@ class testVifibMixin(ERP5TypeTestCase): ...@@ -289,7 +294,7 @@ class testVifibMixin(ERP5TypeTestCase):
self.setSystemPreference() self.setSystemPreference()
self.setupRuleTool() self.setupRuleTool()
self.setupNotificationModule() self.setupNotificationModule()
self.openAssignments() self.prepareTestUsers()
transaction.commit() transaction.commit()
self.tic() self.tic()
self.logout() self.logout()
......
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