Emergency fixes on prod

This commit is contained in:
James Pattinson
2026-06-28 08:35:39 +00:00
parent 5e12561fb2
commit 870bc0649b
4 changed files with 74 additions and 17 deletions
+35
View File
@@ -194,6 +194,7 @@ def test_local_flight_lifecycle_special_lists_and_not_found_paths(auth_client, d
assert departed_response.status_code == 200
assert departed_response.json()["takeoff_dt"] == "2026-06-20T10:05:00"
assert departed_response.json()["departed_dt"] == "2026-06-20T10:05:00"
assert landed_response.status_code == 200
assert landed_response.json()["landed_dt"] == "2026-06-20T10:45:00"
@@ -222,6 +223,40 @@ def test_local_flight_lifecycle_special_lists_and_not_found_paths(auth_client, d
assert auth_client.delete("/api/v1/local-flights/404").status_code == 404
def test_local_flight_takeoff_to_local_sets_departed_dt(auth_client):
create_response = auth_client.post(
"/api/v1/local-flights/",
json={
"registration": "g-air",
"type": "PA28",
"pob": 2,
"flight_type": "LOCAL",
"duration": 30,
"etd": "2026-06-20T09:00:00",
},
)
assert create_response.status_code == 200
takeoff_response = auth_client.patch(
f"/api/v1/local-flights/{create_response.json()['id']}/status",
json={"status": "LOCAL", "timestamp": "2026-06-20T09:05:00"},
)
assert takeoff_response.status_code == 200
assert takeoff_response.json()["status"] == "LOCAL"
assert takeoff_response.json()["takeoff_dt"] == "2026-06-20T09:05:00"
assert takeoff_response.json()["departed_dt"] == "2026-06-20T09:05:00"
landing_response = auth_client.patch(
f"/api/v1/local-flights/{create_response.json()['id']}/status",
json={"status": "LANDED", "timestamp": "2026-06-20T09:35:00"},
)
assert landing_response.status_code == 200
assert landing_response.json()["status"] == "LANDED"
assert landing_response.json()["landed_dt"] == "2026-06-20T09:35:00"
def test_overflight_lifecycle_special_lists_and_not_found_paths(auth_client, db):
payload = {
"registration": "g-ovr",