Commit bfdfd565 authored by Yusei Tahara's avatar Yusei Tahara

Added a test for catalog with very long login name.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21081 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 739efb1b
...@@ -257,6 +257,31 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -257,6 +257,31 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
module_portal_type, module_portal_type,
self.portal.getDefaultModule(module_portal_type).getPortalType()) self.portal.getDefaultModule(module_portal_type).getPortalType())
def test_catalog_with_very_long_login_name(self, quiet=quiet, run=run_all_test):
"""Make sure that user with very long login name can find his document by catalog"""
portal = self.getPortal()
# Create user account with very long login name
login_name = 'very_very_looooooooooooooooong_login_name'
password = 'password'
acl_users = portal.acl_users
acl_users._doAddUser(login_name, password, ['Member'], [])
user = acl_users.getUserById(login_name).__of__(acl_users)
# Login as the above user
newSecurityManager(None, user)
get_transaction().commit()
# Create preference
portal.portal_preferences.newContent('Preference', title='My Test Preference')
get_transaction().commit()
self.tic()
self.assertEqual(
len(portal.portal_catalog(portal_type='Preference',
title='My Test Preference')),
1)
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestERP5Core)) suite.addTest(unittest.makeSuite(TestERP5Core))
......
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