This commit is contained in:
@@ -194,6 +194,11 @@ def as_role(app, client, make_user, login):
|
||||
from app.models import User
|
||||
|
||||
username = _db.session.get(User, user_id).username
|
||||
# The login route short-circuits when the client is already
|
||||
# authenticated, so a previous as_role() call would otherwise leave
|
||||
# the old identity in the session and the switch would silently not
|
||||
# happen (ADMIN-010: coach/manager gate tests ran as admin).
|
||||
client.post('/auth/logout', follow_redirects=False)
|
||||
response = login(username)
|
||||
assert response.status_code in (301, 302), (
|
||||
f'login for {username} did not redirect: {response.status_code}'
|
||||
|
||||
Reference in New Issue
Block a user