def test_api_can_query_by_team_emails():
    """Can an admin user query /api/v1/teams using a teams's email address"""
    app = create_ctfd(user_mode="teams")
    with app.app_context():
        gen_team(app.db, email="team@findme.com")
        register_user(app, name="testuser", email="user@findme.com")
        with login_as_user(app, "testuser") as client:
            r = client.get("/api/v1/teams?field=email&q=findme", json=True)
            assert r.status_code == 400
            assert r.get_json()["errors"].get("field")
        with login_as_user(app, "admin") as client:
            r = client.get("/api/v1/teams?field=email&q=findme", json=True)
            assert r.status_code == 200
            assert r.get_json()["data"][0]["id"] == 1
            assert r.get_json()["data"][0]["name"] == "team_name"
    destroy_ctfd(app)
Can an admin user query /api/v1/teams using a teams's email address
tests/api/v1/teams/test_teams.py