def METHOD_NAME(add_battery_assets, process):
    """
    Test ProcessScheduler with a time restrictions consisting of a block of 2h starting
    at 8am. The resulting schedules avoid the 8am-10am period and schedules for a valid period.
    """
    # get the sensors from the database
    epex_da = Sensor.query.filter(Sensor.name == "epex_da").one_or_none()
    # time parameters
    flex_model = {
        "duration": "PT4H",
        "process-type": "SHIFTABLE",
        "power": 4,
        "time-restrictions": [
            {"start": "2015-01-02T08:00:00+01:00", "duration": "PT2H"}
        ],
    }
    flex_context = {
        "consumption-price-sensor": epex_da.id,
    }
    scheduler = ProcessScheduler(
        process,
        start,
        end,
        resolution,
        flex_model=flex_model,
        flex_context=flex_context,
    )
    schedule = scheduler.compute()
    optimal_start = tz.localize(datetime(2015, 1, 2, 10))
    mask = (optimal_start <= schedule.index) & (
        schedule.index < optimal_start + timedelta(hours=4)
    )
    assert (schedule[mask] == 4).all()
    assert (schedule[~mask] == 0).all()
    # check that the time restrictions are fulfilled
    time_restrictions = scheduler.flex_model["time_restrictions"]
    time_restrictions = time_restrictions.tz_convert(tz)
    assert (schedule[time_restrictions] == 0).all()