1
0
mirror of https://github.com/kakwa/ldapcherry synced 2024-11-22 01:14:21 +01:00

adding utf-8 char in unit tests for ldap backend

This commit is contained in:
kakwa 2015-07-29 00:09:32 +02:00
parent 69700d0ce9
commit 5d40cad342

View File

@ -170,9 +170,13 @@ class TestError(object):
assert ret == expected
def testAddUser(self):
try:
inv.del_user(u'test☭')
except:
pass
inv = Backend(cfg, cherrypy.log, 'ldap', attr, 'uid')
user = {
'uid': 'test',
'uid': u'test',
'sn': 'test',
'cn': 'test',
'userPassword': 'test',
@ -181,12 +185,12 @@ class TestError(object):
'homeDirectory': '/home/test/'
}
inv.add_user(user)
inv.del_user('test')
inv.del_user(u'test')
def testModifyUser(self):
inv = Backend(cfg, cherrypy.log, 'ldap', attr, 'uid')
user = {
'uid': 'test',
'uid': u'test',
'sn': 'test',
'cn': 'test',
'userPassword': 'test',
@ -195,8 +199,8 @@ class TestError(object):
'homeDirectory': '/home/test/'
}
inv.add_user(user)
inv.set_attrs('test', {'gecos': 'test2', 'homeDirectory': '/home/test/'})
inv.del_user('test')
inv.set_attrs(u'test', {'gecos': 'test2', 'homeDirectory': '/home/test/'})
inv.del_user(u'test')
def testAddUserDuplicate(self):
inv = Backend(cfg, cherrypy.log, 'ldap', attr, 'uid')