Commit 822cab72 authored by Nicolas Dumazet's avatar Nicolas Dumazet

add a generic createUser function to help during test setups


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29475 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5fc0276a
......@@ -590,6 +590,23 @@ class ERP5TypeTestCase(PortalTestCase):
if verbose:
ZopeTestCase._print(' done (%.3fs)\n' % (time.time() - start))
def createUser(self, title, reference, password=None, function=None):
"""
Create an ERP5 User, and create her an assignment.
Default password is the reference.
"""
if password is None:
password = reference
person = self.portal.person_module.newContent(portal_type='Person',
title=title,
reference=reference,
password=password,
function=function)
# and assign her function
assignment = person.newContent(portal_type='Assignment',
function=function)
assignment.open()
def failIfDifferentSet(self, a, b, msg=""):
if not msg:
msg='%r != %r' % (a, b)
......
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