def get_current_user(): user_id = session.get("user_id") if user_id: return Users.get(user_id) else: return False
def test_get_nonexistent_user(): with pytest.raises(NotFoundError): Users.get(uuid4())
def remove_access(user_id): user = Users.get(user_id) Users.revoke_ccpo_perms(user) flash("ccpo_user_removed", user_name=user.full_name) return redirect(url_for("ccpo.users"))
def test_get_user(): new_user = UserFactory.create() user = Users.get(new_user.id) assert user.id == new_user.id