Пример #1
0
    def test_normalusage(self):
        """
        Tests that ldaplib works correctly or not.
        """
        user=User()
        user.username="******"
        user.first_name="first"
        user.last_name="last"
        user.email="*****@*****.**"
        user.is_active=True
        ldaplib.save(user)

        ld=ldaplib.init_bind()
        result=ldaplib.search(user.username,ld)
        self.assertEqual(1,len(result))

        self.assertEqual(False,ldaplib.searchDenylist(user.username,ld))
        ld.unbind()

        password="******"
        ldaplib.changePassword(user,password)
        user.last_name="lastmod"
        user.email="*****@*****.**"
        ldaplib.save(user)
        user.is_active=False
        ldaplib.save(user)

        ld=ldaplib.init_bind()
        #result=ldaplib.search(user.username,ld)
        #print(result)
        self.assertEqual(True,ldaplib.searchDenylist(user.username,ld))
        ld.unbind()

        ldaplib.delete(user)
Пример #2
0
 def setUp(self):
     user=User()
     user.username="******"
     user.first_name="first"
     user.last_name="last"
     ldaplib.delete(user)
     user.username="******"
     ldaplib.delete(user)
Пример #3
0
def account_delete_expunge(deletion):
    ldaplib.delete(deletion.user)
    callbacks.account_delete_expunge(deletion)
    deletion.user=None