diff --git a/camply/providers/usedirect/usedirect.py b/camply/providers/usedirect/usedirect.py index 29008a46..0e0553b2 100644 --- a/camply/providers/usedirect/usedirect.py +++ b/camply/providers/usedirect/usedirect.py @@ -304,11 +304,12 @@ def get_campsites_response( ------- UseDirectAvailabilityResponse """ + greatest_start = max(start_date, date.today() - timedelta(days=1)) data = { "IsADA": is_ada, "MinVehicleLength": min_vehicle_length, "UnitCategoryId": unit_category_id, - "StartDate": start_date.strftime(UseDirectConfig.DATE_FORMAT), + "StartDate": greatest_start.strftime(UseDirectConfig.DATE_FORMAT), "WebOnly": web_only, "UnitTypesGroupIds": [] if unit_type_group_ids is None diff --git a/tests/debug_camply.py b/tests/debug_camply.py new file mode 100644 index 00000000..625a18a3 --- /dev/null +++ b/tests/debug_camply.py @@ -0,0 +1,23 @@ +""" +Debugging Script +""" + +from tests.conftest import CamplyRunner + + +def test_debug_usedirect(cli_runner: CamplyRunner) -> None: + """ + Debug the Camply CLI - ReserveCalifornia - UseDirect + + https://reservecalifornia.com/Web/#!park/726/737 + """ + test_command = """ + camply \ + campsites \ + --provider ReserveCalifornia \ + --campground 737 \ + --start-date 2024-04-29 \ + --end-date 2024-04-30 + """ + result = cli_runner.run_camply_command(command=test_command) + assert result.exit_code == 0