Commit ba01147e authored by Vincent Desmares's avatar Vincent Desmares

Update the test of ERP5Core to test the publish method with very long login/password

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23044 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d8e87e7a
...@@ -46,8 +46,9 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -46,8 +46,9 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
""" """
run_all_test = 1 run_all_test = 1
quiet = 1 quiet = 1
manager_username = 'rc' manager_username = 'rc'
manager_password = '' manager_password = 'w'
def getTitle(self): def getTitle(self):
return "ERP5Core" return "ERP5Core"
...@@ -266,14 +267,16 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -266,14 +267,16 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
"""Make sure that user with very long login name can find his document by catalog""" """Make sure that user with very long login name can find his document by catalog"""
portal = self.getPortal() portal = self.getPortal()
# Create user account with very long login name # Create user account with very long login name
login_name = 'very_very_looooooooooooooooong_login_name' login_name = 'very_very_looooooooooooooooooooooooooooooooooooooooooooooooooooo' + \
password = 'password' 'oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_login_name'
password = 'very_long_passworddddddddddddddddddddddddddddddddddddddddddddddddd' + \
'ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd'
acl_users = portal.acl_users acl_users = portal.acl_users
acl_users._doAddUser(login_name, password, ['Member'], []) acl_users._doAddUser(login_name, password, ['Member'], [])
user = acl_users.getUserById(login_name).__of__(acl_users) user = acl_users.getUserById(login_name).__of__(acl_users)
# Login as the above user # Login as the above user
newSecurityManager(None, user) newSecurityManager(None, user)
self.auth = '%s:%s' % (login_name, password)
get_transaction().commit() get_transaction().commit()
# Create preference # Create preference
...@@ -286,6 +289,8 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -286,6 +289,8 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
len(portal.portal_catalog(portal_type='Preference', len(portal.portal_catalog(portal_type='Preference',
title='My Test Preference')), title='My Test Preference')),
1) 1)
response = self.publish('%s/view' % self.portal_id, self.auth)
self.assertEquals(HTTP_OK, response.getStatus())
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
......
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