Ver Fonte

test: fix vehicle recharge apply fixtures for required fields.

Schema now requires odometerKm and attachmentUrls; update type tests so the suite stays green.

Co-authored-by: Cursor <cursoragent@cursor.com>
wuzilong há 2 semanas atrás
pai
commit
a5976350ab
1 ficheiros alterados com 6 adições e 0 exclusões
  1. 6 0
      backend/tests/test_vehicle_recharge_types.py

+ 6 - 0
backend/tests/test_vehicle_recharge_types.py

@@ -21,6 +21,8 @@ def test_apply_create_accepts_fuel():
             "licensePlate": "鄂A12345",
             "rechargeType": "fuel",
             "applyDate": "2026-09-12",
+            "odometerKm": "1000",
+            "attachmentUrls": "pl/vehicle-recharge/a.jpg",
         }
     )
     assert obj.recharge_type == "fuel"
@@ -32,6 +34,8 @@ def test_apply_create_accepts_etc():
             "licensePlate": "鄂A12345",
             "rechargeType": "etc",
             "applyDate": "2026-09-12",
+            "odometerKm": "1000",
+            "attachmentUrls": "pl/vehicle-recharge/a.jpg",
         }
     )
     assert obj.recharge_type == "etc"
@@ -44,6 +48,8 @@ def test_apply_create_rejects_unknown_type():
                 "licensePlate": "鄂A12345",
                 "rechargeType": "other",
                 "applyDate": "2026-09-12",
+                "odometerKm": "1000",
+                "attachmentUrls": "pl/vehicle-recharge/a.jpg",
             }
         )