示例#1
0
 def test_missing_mail(self):
     with mock_ldap() as ldap:
         (response, err_msg) = ldap.get_user("nomail")
         self.assertIsNone(response)
         self.assertEquals('Missing mail field "mail" in user record', err_msg)
示例#2
0
 def test_missing_mail_allowed(self):
     with mock_ldap(requires_email=False) as ldap:
         (response, _) = ldap.get_user("nomail")
         self.assertEquals(response.username, "nomail")
示例#3
0
 def test_bytes_in_results(self):
     with mock_ldap() as ldap:
         (response, _) = ldap.get_user("bytesuser")
         self.assertEqual(response.username, "bytesuser")