mirror of
https://github.com/simple-login/app.git
synced 2024-11-02 20:01:01 +01:00
ba15837b01
- non-authenticated user, - non supported flow - authorization page displayed correctly - code flow without openid in scope - code flow with openid in scope
24 lines
528 B
Python
24 lines
528 B
Python
from flask import url_for
|
|
|
|
from app.extensions import db
|
|
from app.models import User
|
|
|
|
|
|
def login(flask_client) -> User:
|
|
# create user, user is activated
|
|
user = User.create(
|
|
email="a@b.c", password="password", name="Test User", activated=True
|
|
)
|
|
db.session.commit()
|
|
|
|
r = flask_client.post(
|
|
url_for("auth.login"),
|
|
data={"email": "a@b.c", "password": "password"},
|
|
follow_redirects=True,
|
|
)
|
|
|
|
assert r.status_code == 200
|
|
assert b"/auth/logout" in r.data
|
|
|
|
return user
|