Esempio n. 1
0
 def test_add_user_from_ldap(self):
     ldap_connection = LDAPConnection()
     ldap_login = '******'
     ldap_name = 'test-ldap-name'
     user = ldap_connection._add_from_ldap(username=ldap_login, userdata=({},{'gecos':ldap_name}))
     self.assertEqual(user['login'], ldap_login)
     self.assertEqual(user['name'], ldap_name)
Esempio n. 2
0
 def test_add_user_from_ldap(self):
     ldap_connection = LDAPConnection()
     ldap_login = '******'
     ldap_name = 'test-ldap-name'
     user = ldap_connection._add_from_ldap(username=ldap_login, userdata=({},{'gecos':ldap_name}))
     self.assertEqual(user['login'], ldap_login)
     self.assertEqual(user['name'], ldap_name)
Esempio n. 3
0
 def test_add_user_from_ldap_unsupported_gecos(self):
     # Make sure that if gecos is not a basestring with user's name in it, we default it to user login
     # without raising any error
     ldap_connection = LDAPConnection()
     ldap_login = '******'
     ldap_gecos = ['blah','blah']
     user = ldap_connection._add_from_ldap(username=ldap_login, userdata=({},{'gecos':ldap_gecos}))
     self.assertEqual(user['login'], ldap_login)
     self.assertEqual(user['name'], ldap_login)
Esempio n. 4
0
 def test_add_user_from_ldap_unsupported_gecos(self):
     # Make sure that if gecos is not a basestring with user's name in it, we default it to user login
     # without raising any error
     ldap_connection = LDAPConnection()
     ldap_login = '******'
     ldap_gecos = ['blah','blah']
     user = ldap_connection._add_from_ldap(username=ldap_login, userdata=({},{'gecos':ldap_gecos}))
     self.assertEqual(user['login'], ldap_login)
     self.assertEqual(user['name'], ldap_login)