Ejemplo n.º 1
0
def test_create_user():
    username = '******'
    password = '******'

    mod.create_user(username, password)

    db = mod.request.db.sessions
    query = db.Select(sets='users', where='username = ?')
    db.query(query, username)
    user = db.result

    assert user.username == username
    assert user.is_superuser == 0
    assert mod.is_valid_password(password, user.password)
Ejemplo n.º 2
0
def test_password_encryption():
    encrypted = mod.encrypt_password('super secure')
    assert mod.is_valid_password('super secure', encrypted)