Commit 177e58d5 authored by Sebastien Robin's avatar Sebastien Robin

set the site when we create a new person

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12571 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 98b26ca3
...@@ -70,7 +70,7 @@ class TestERP5BankingMixin: ...@@ -70,7 +70,7 @@ class TestERP5BankingMixin:
# we use PAS # we use PAS
self.PAS_installed = 1 self.PAS_installed = 1
def updateRoleMappings(self, portal_type_list=''): def updateRoleMappings(self, portal_type_list=None):
"""Update the local roles in existing objects. """Update the local roles in existing objects.
""" """
portal_catalog = self.portal.portal_catalog portal_catalog = self.portal.portal_catalog
...@@ -105,14 +105,16 @@ class TestERP5BankingMixin: ...@@ -105,14 +105,16 @@ class TestERP5BankingMixin:
for user_login, user_data in user_dict.items(): for user_login, user_data in user_dict.items():
user_roles = user_data[0] user_roles = user_data[0]
# Create the Person. # Create the Person.
main_site = '/'.join(user_data[4].split('/')[0:2])
person = self.person_module.newContent(id=user_login, person = self.person_module.newContent(id=user_login,
portal_type='Person', reference=user_login, career_role="internal") portal_type='Person', reference=user_login, career_role="internal",
site=main_site)
# Create the Assignment. # Create the Assignment.
assignment = person.newContent( portal_type = 'Assignment' assignment = person.newContent( portal_type = 'Assignment'
, destination_value = user_data[1] , destination_value = user_data[1]
, function = "function/%s" %user_data[2] , function = "function/%s" %user_data[2]
, group = "group/%s" %user_data[3] , group = "group/%s" %user_data[3]
, site = "site/%s" %user_data[4] , site = "%s" %user_data[4]
, start_date = '01/01/1900' , start_date = '01/01/1900'
, stop_date = '01/01/2900' , stop_date = '01/01/2900'
) )
...@@ -645,14 +647,17 @@ class TestERP5BankingMixin: ...@@ -645,14 +647,17 @@ class TestERP5BankingMixin:
doc.Baobab_getUniqueReference() doc.Baobab_getUniqueReference()
def createPerson(self, id, first_name, last_name): def createPerson(self, id, first_name, last_name,site=None):
""" """
Create a person Create a person
""" """
if site is None:
site="testsite/paris"
return self.person_module.newContent(id = id, return self.person_module.newContent(id = id,
portal_type = 'Person', portal_type = 'Person',
first_name = first_name, first_name = first_name,
last_name = last_name) last_name = last_name,
site=site)
def createBankAccount(self, person, account_id, currency, amount, **kw): def createBankAccount(self, person, account_id, currency, amount, **kw):
......
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