Summary
There are 14 skipped tests in tests/test_thing.py that need to be updated to match the current API response schema.
Problem
The tests were skipped with the message "Needs to be updated per changes made from feature files". Investigation revealed:
- Required fields changed:
CreateWell now requires measuring_point_height and is_suitable_for_datalogger fields
- Response format changed:
current_location is now returned as GeoJSON (LocationGeoJSONResponse) instead of flat LocationResponse
- Fields removed:
well_construction_notes is no longer in the response schema
Tests to Update
POST tests (need new required fields + response updates)
test_add_water_well
test_add_water_well_with_measuring_point
test_add_water_well_409_bad_group_id
test_add_water_well_409_bad_location_id
test_add_spring
test_add_spring_409_bad_group_id
test_add_spring_409_bad_location_id
GET tests (need response schema updates)
test_get_water_wells
test_get_water_well_by_id (also covered by feature files)
test_get_springs
test_get_spring_by_id
test_get_thing_by_id
PATCH tests (need response schema updates)
test_patch_water_well
test_patch_spring
Required Changes
- Add
measuring_point_height and is_suitable_for_datalogger to well creation payloads
- Update assertions to use GeoJSON format for
current_location:
# Old format
assert data["current_location"] == LocationResponse.model_validate(location).model_dump(mode="json")
# New format (GeoJSON Feature)
assert data["current_location"]["type"] == "Feature"
assert data["current_location"]["geometry"]["type"] == "Point"
- Remove assertions for
well_construction_notes (no longer in response)
- Update field assertions to match current
WellResponse/SpringResponse schemas
Related
- Some of these tests may overlap with BDD feature tests in
tests/features/
Summary
There are 14 skipped tests in
tests/test_thing.pythat need to be updated to match the current API response schema.Problem
The tests were skipped with the message "Needs to be updated per changes made from feature files". Investigation revealed:
CreateWellnow requiresmeasuring_point_heightandis_suitable_for_dataloggerfieldscurrent_locationis now returned as GeoJSON (LocationGeoJSONResponse) instead of flatLocationResponsewell_construction_notesis no longer in the response schemaTests to Update
POST tests (need new required fields + response updates)
test_add_water_welltest_add_water_well_with_measuring_pointtest_add_water_well_409_bad_group_idtest_add_water_well_409_bad_location_idtest_add_springtest_add_spring_409_bad_group_idtest_add_spring_409_bad_location_idGET tests (need response schema updates)
test_get_water_wellstest_get_water_well_by_id(also covered by feature files)test_get_springstest_get_spring_by_idtest_get_thing_by_idPATCH tests (need response schema updates)
test_patch_water_welltest_patch_springRequired Changes
measuring_point_heightandis_suitable_for_dataloggerto well creation payloadscurrent_location:well_construction_notes(no longer in response)WellResponse/SpringResponseschemasRelated
tests/features/