def test_teams_from_admin_hidden():
    """Test that teams created by admins in /teams/new are hidden by default"""
    app = create_ctfd(user_mode="teams")
    with app.app_context():
        gen_user(app.db, name="user")
        with login_as_user(app) as client:
            with client.session_transaction() as sess:
                data = {
                    "name": "team_user",
                    "password": "password",
                    "nonce": sess.get("nonce"),
                }
            r = client.post("/teams/new", data=data)
            assert r.status_code == 302

            team = Teams.query.filter_by(name="team_user").first()
            assert team.hidden == False

        with login_as_user(app, "admin") as client:
            with client.session_transaction() as sess:
                data = {
                    "name": "team_admin",
                    "password": "password",
                    "nonce": sess.get("nonce"),
                }
            r = client.post("/teams/new", data=data)
            assert r.status_code == 302

            team = Teams.query.filter_by(name="team_admin").first()
            assert team.hidden == True
    destroy_ctfd(app)
Test that teams created by admins in /teams/new are hidden by default
tests/teams/test_auth.py