示例#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 account_delete_mark(deletion):
    callbacks.account_delete_mark(deletion)
    ldaplib.save(deletion.user)