test: make booking overlap assertion deterministic

This commit is contained in:
NuklearRabbit
2026-08-10 02:53:40 +02:00
parent de151914b6
commit b2e1ae7f17
+6 -3
View File
@@ -21,11 +21,14 @@ def test_list_bookings_supports_bounded_search_pages(ops_client):
def test_create_booking_rejects_overlap_and_audits_valid_booking(ops_client):
existing = ops_client.get("/api/v1/bookings/BK-DEMO-RETURN").json()
conflict = ops_client.post(
"/api/v1/bookings",
json={
"customer_ref": "CUS-0001", "vehicle_ref": "MO-024",
"starts_at": "2026-08-10T10:00:00Z", "ends_at": "2026-08-10T12:00:00Z",
"customer_ref": "CUS-0001",
"vehicle_ref": existing["vehicle_ref"],
"starts_at": existing["starts_at"],
"ends_at": existing["ends_at"],
},
)
assert conflict.status_code == 409
@@ -33,7 +36,7 @@ def test_create_booking_rejects_overlap_and_audits_valid_booking(ops_client):
"/api/v1/bookings",
json={
"customer_ref": "CUS-0001", "vehicle_ref": "MO-001",
"starts_at": "2026-09-01T10:00:00Z", "ends_at": "2026-09-02T12:00:00Z",
"starts_at": "2030-09-01T10:00:00Z", "ends_at": "2030-09-02T12:00:00Z",
},
)
assert created.status_code == 201