def test_login_new_user(): with fake_openid(): resp = client.get('/openid-return') assert_eq(resp.status_code, 302) assert_eq(resp.location, 'http://localhost/register') assert_eq(app.db.session.query(app.db.OpenId.openid).all(), [('http://uowe.it/root',)])
def test_register(): user = create_user() with client.session_transaction() as sess: sess['user_id'] = user.id resp = client.get('/register') assert_eq(resp.status_code, 200) resp = client.post('/register', data={ 'name': 'Odin', }) assert_eq(resp.status_code, 302) assert_eq(resp.location, 'http://localhost/')
def test_index(): resp = client.get('/') assert_eq(resp.status_code, 200)