def test_login_suspended(client: TestClient, user: User): with db.begin(): user.Suspended = 1 data = {"user": user.Username, "passwd": "testPassword", "next": "/"} with client as request: resp = request.post("/login", data=data) errors = get_errors(resp.text) assert errors[0].text.strip() == "Account Suspended"
def test_user_login_suspended(user: User): with db.begin(): user.Suspended = True assert not user.login(Request(), "testPassword")