def unique_login(node, value): """ Test login unicity against database """ if not Login.unique_login(value, login_id): message = u"Le login '{0}' n'est pas disponible.".format(value) raise colander.Invalid(node, message)
def unique_login(node, value): """ Test login unicity against database """ if not Login.unique_login(value, login_id): message = u"Le login '{0}' n'est pas disponible.".format( value) raise colander.Invalid(node, message)
def test_unique_user_id(dbsession, login): assert Login.unique_user_id(login.user_id) == False assert Login.unique_user_id("other login") == True assert Login.unique_login(1, login.id) == True
def test_unique_login(dbsession, login): assert Login.unique_login(login.login) == False assert Login.unique_login("test2") == True assert Login.unique_login(login.login, login.id) == True