Beispiel #1
0
def test_login_with_real_account():
    user = auth.User(username='******', email='*****@*****.**')
    user.password = '******'
    user.create()
    login_form = authforms.login_form()
    assert not login_form.validates(
        web.storify({
            'username': '******',
            'password': '******',
        }))
    user.activate()
    user.store()
    assert login_form.validates(
        web.storify({
            'username': '******',
            'password': '******',
        })), login_form.note
    assert not login_form.validates(
        web.storify({
            'username': '******',
            'password': '******',
        }))
    assert not login_form.validates(
        web.storify({
            'username': '******',
            'password': '******',
        }))
Beispiel #2
0
def test_login_with_real_account():
    user = auth.User(username='******', email='*****@*****.**')
    user.password = '******'
    user.create()
    login_form = authforms.login_form()
    assert not login_form.validates(web.storify({
        'username': '******',
        'password': '******',
    }))
    user.activate()
    user.store()
    assert login_form.validates(web.storify({
        'username': '******',
        'password': '******',
    })), login_form.note
    assert not login_form.validates(web.storify({
        'username': '******',
        'password': '******',
    }))
    assert not login_form.validates(web.storify({
        'username': '******',
        'password': '******',
    }))
Beispiel #3
0
def test_login_min_pwd_length():
    login_form = authforms.login_form()
    assert not login_form.password.validate('pas')
    assert login_form.password.validate('pass')
Beispiel #4
0
def test_login_password_nonempty():
    login_form = authforms.login_form()
    # Feed it an emtpy string
    assert not login_form.password.validate('')
Beispiel #5
0
def test_login_form_validates_username():
    login_form = authforms.login_form()
    # Feed it a really short username:
    assert not login_form.username.validate('us')
Beispiel #6
0
def test_login_form():
    login_form = authforms.login_form()
    assert isinstance(login_form, web.form.Form)
Beispiel #7
0
def test_login_min_pwd_length():
    login_form = authforms.login_form()
    assert not login_form.password.validate('pas')
    assert login_form.password.validate('pass')
Beispiel #8
0
def test_login_password_nonempty():
    login_form = authforms.login_form()
    # Feed it an emtpy string
    assert not login_form.password.validate('')
Beispiel #9
0
def test_login_form_validates_username():
    login_form = authforms.login_form()
    # Feed it a really short username:
    assert not login_form.username.validate('us')
Beispiel #10
0
def test_login_form():
    login_form = authforms.login_form()
    assert isinstance(login_form, web.form.Form)