def test_brackets_delete_api():
    """Test that brackets API DELETE endpiont is behaving propertly"""
    app = create_ctfd()
    with app.app_context():
        gen_bracket(app.db, name="players1")
        assert Brackets.query.count() == 1

        register_user(app, bracket_id=1)
        with login_as_user(app) as client:
            r = client.delete("/api/v1/brackets/1", json="")
            assert r.status_code == 403
            assert Brackets.query.count() == 1

        with login_as_user(app, name="admin") as client:
            r = client.delete("/api/v1/brackets/1", json="")
            print(r.get_json())
            assert r.status_code == 200
            assert Brackets.query.count() == 0
    destroy_ctfd(app)
Test that brackets API DELETE endpiont is behaving propertly
tests/api/v1/test_brackets.py