Commit e233c7fe authored by Arnaud Fontaine's avatar Arnaud Fontaine

createERP5User does not use ERP5 so use HTTP Authentication instead.

parent 4bb25df1
...@@ -27,8 +27,6 @@ except ValueError: ...@@ -27,8 +27,6 @@ except ValueError:
# Create a browser instance # Create a browser instance
browser = Browser(url, username, password) browser = Browser(url, username, password)
browser.open()
browser.mainForm.submitLogin()
erp5_role_tuple = ('Assignee', erp5_role_tuple = ('Assignee',
'Assignor', 'Assignor',
...@@ -46,6 +44,11 @@ post_data_format = "submit=Add&roles:list=Manager&roles:list=Owner&name=" \ ...@@ -46,6 +44,11 @@ post_data_format = "submit=Add&roles:list=Manager&roles:list=Owner&name=" \
# TODO: Because of post() not wrapped properly # TODO: Because of post() not wrapped properly
zope_url = url.rsplit('/', 2)[0] zope_url = url.rsplit('/', 2)[0]
import base64
browser.mech_browser.addheaders.append(
('Authorization',
'Basic %s' % base64.encodestring('%s:%s' % (username, password))))
for index in range(user_nbr): for index in range(user_nbr):
new_username = "%s%d" % (new_username_prefix, index) new_username = "%s%d" % (new_username_prefix, index)
......
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