def test_scoreboard_tie_break_ordering_with_awards_under_teams():
    """
    Test that team mode scoreboard tie break ordering respects the addition of awards
    """
    app = create_ctfd(user_mode="teams")
    with app.app_context():
        gen_team(app.db, name="team1", email="team1@examplectf.com")
        gen_team(app.db, name="team2", email="team2@examplectf.com")

        chal = gen_challenge(app.db, value=100)
        gen_flag(app.db, challenge_id=chal.id, content="flag")

        chal = gen_challenge(app.db, value=200)
        gen_flag(app.db, challenge_id=chal.id, content="flag")

        # create solves for the challenges. (the user_ids are off by 1 because of the admin)
        gen_solve(app.db, user_id=2, team_id=1, challenge_id=1)
        gen_solve(app.db, user_id=6, team_id=2, challenge_id=2)

        user = Users.query.filter_by(id=2).first()

        with login_as_user(app, user.name) as client:
            r = client.get("/api/v1/scoreboard")
            resp = r.get_json()
            print(resp)
            assert len(resp["data"]) == 2
            assert resp["data"][0]["name"] == "team2"
            assert resp["data"][0]["score"] == 200
            assert resp["data"][1]["name"] == "team1"
            assert resp["data"][1]["score"] == 100

        # Give a user on the team an award for 100 points.
        # At this point team2 should still be ahead
        gen_award(app.db, user_id=3, team_id=1, value=100)

        with login_as_user(app, user.name) as client:
            r = client.get("/api/v1/scoreboard")
            resp = r.get_json()
            print(resp)
            assert len(resp["data"]) == 2
            assert resp["data"][0]["name"] == "team2"
            assert resp["data"][0]["score"] == 200
            assert resp["data"][1]["name"] == "team1"
            assert resp["data"][1]["score"] == 200
    destroy_ctfd(app)

    Test that team mode scoreboard tie break ordering respects the addition of awards
    
tests/api/v1/test_scoreboard.py