def test_api_users_get_private():
    """Can a user get /api/v1/users if users are public"""
    app = create_ctfd()
    with app.app_context():
        with app.test_client() as client:
            set_config("account_visibility", "public")
            r = client.get("/api/v1/users")
            assert r.status_code == 200
            set_config("account_visibility", "private")
            r = client.get("/api/v1/users")
            assert r.status_code == 302
            set_config("account_visibility", "admins")
            r = client.get("/api/v1/users")
            assert r.status_code == 404
    destroy_ctfd(app)
Can a user get /api/v1/users if users are public
tests/api/v1/test_users.py