def testSetPassword(self): inv = Backend(cfg, cherrypy.log, u'test☭', attr, 'sAMAccountName') try: inv.add_user(default_user.copy()) inv.add_to_groups(u'☭default_user', default_groups) except: pass inv.set_attrs(u'☭default_user', {'unicodePwd': u'test☭P66642$'}) ret = inv.auth(u'☭default_user', u'test☭P66642$') inv.del_user(u'☭default_user') assert ret == True
def testAuthFailure(self): inv = Backend(cfg, cherrypy.log, u'test☭', attr, 'sAMAccountName') res = inv.auth('notauser', 'password') or inv.auth( u'☭default_user', 'notapassword') assert res == False
def testAuthSuccess(self): inv = Backend(cfg, cherrypy.log, u'test☭', attr, 'sAMAccountName') ret = inv.auth('Administrator', 'qwertyP455') assert ret == True
def testAuthFailure(self): inv = Backend(cfg, cherrypy.log, u'test☭', attr, 'sAMAccountName') res = inv.auth('notauser', 'password') or inv.auth(u'☭default_user', 'notapassword') assert res == False