示例#1
0
 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)
示例#2
0
 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)
示例#3
0
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
示例#4
0
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
示例#5
0
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
示例#6
0
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