コード例 #1
0
ファイル: test_auth.py プロジェクト: hucruz/acl.py
def test_registration_fails_if_user_exists():
    user = auth.User(username='******', email='*****@*****.**')
    user.create()
    reg_form = authforms.register_form()
    assert not reg_form.validates(
        web.storify({
            'username': '******',
            'email': '*****@*****.**',
            'password': '******',
            'confirm': 'abc123',
        }))
    assert not reg_form.validates(
        web.storify({
            'username': '******',
            'email': '*****@*****.**',  # still the same e-mail
            'password': '******',
            'confirm': 'abc123',
        }))
    assert not reg_form.validates(
        web.storify({
            'username': '******',
            'email': '*****@*****.**',
            'password': '******',
            'confirm': 'abc123',
        }))
コード例 #2
0
ファイル: test_auth.py プロジェクト: andyjia/acl.py
def test_registration_pw_confirmation():
    reg_form = authforms.register_form()
    assert reg_form.validates(web.storify({
        'username': '******',
        'email': '*****@*****.**',
        'password': '******',
        'confirm': 'abc123'
    })), reg_form.note
    assert not reg_form.validates(web.storify({
        'username': '******',
        'email': '*****@*****.**',
        'password': '******',
        'confirm': 'wont repeat'
    }))
コード例 #3
0
ファイル: test_auth.py プロジェクト: hucruz/acl.py
def test_registration_pw_confirmation():
    reg_form = authforms.register_form()
    assert reg_form.validates(
        web.storify({
            'username': '******',
            'email': '*****@*****.**',
            'password': '******',
            'confirm': 'abc123'
        })), reg_form.note
    assert not reg_form.validates(
        web.storify({
            'username': '******',
            'email': '*****@*****.**',
            'password': '******',
            'confirm': 'wont repeat'
        }))
コード例 #4
0
ファイル: test_auth.py プロジェクト: andyjia/acl.py
def test_registration_fails_if_user_exists():
    user = auth.User(username='******', email='*****@*****.**')
    user.create()
    reg_form = authforms.register_form()
    assert not reg_form.validates(web.storify({
        'username': '******',
        'email': '*****@*****.**',
        'password': '******',
        'confirm': 'abc123',
    }))
    assert not reg_form.validates(web.storify({
        'username': '******',
        'email': '*****@*****.**', # still the same e-mail
        'password': '******',
        'confirm': 'abc123',
    }))
    assert not reg_form.validates(web.storify({
        'username': '******',
        'email': '*****@*****.**',
        'password': '******',
        'confirm': 'abc123',
    }))
コード例 #5
0
ファイル: test_auth.py プロジェクト: andyjia/acl.py
def check_reg_invalid_emails(email):
    reg_form = authforms.register_form()
    assert not reg_form.email.validate(email)
コード例 #6
0
ファイル: test_auth.py プロジェクト: andyjia/acl.py
def test_registration_email_validation():
    reg_form = authforms.register_form()
    reg_from = authforms.register_form()
    assert reg_form.email.validate('*****@*****.**')
    for e in invalid_emails:
        yield check_reg_invalid_emails, e
コード例 #7
0
ファイル: test_auth.py プロジェクト: andyjia/acl.py
def test_registration_form():
    reg_form = authforms.register_form()
    assert isinstance(reg_form, web.form.Form)
コード例 #8
0
ファイル: test_auth.py プロジェクト: hucruz/acl.py
def check_reg_invalid_emails(email):
    reg_form = authforms.register_form()
    assert not reg_form.email.validate(email)
コード例 #9
0
ファイル: test_auth.py プロジェクト: hucruz/acl.py
def test_registration_email_validation():
    reg_form = authforms.register_form()
    reg_from = authforms.register_form()
    assert reg_form.email.validate('*****@*****.**')
    for e in invalid_emails:
        yield check_reg_invalid_emails, e
コード例 #10
0
ファイル: test_auth.py プロジェクト: hucruz/acl.py
def test_registration_form():
    reg_form = authforms.register_form()
    assert isinstance(reg_form, web.form.Form)