@@ -152,6 +152,35 @@ def test_add_water_well(location, group):
152152 cleanup_post_test (Thing , data ["id" ])
153153
154154
155+ def test_add_water_well_with_measuring_point (location , group ):
156+ """
157+ Test creating a well with measuring_point_height and measuring_point_description.
158+
159+ This reproduces the bug where measuring_point fields are properties (from MeasuringPointHistory table)
160+ and cannot be set directly on Thing objects.
161+
162+ Expected error (before fix): AttributeError: property 'measuring_point_height' of 'Thing' object has no setter
163+ """
164+ payload = {
165+ "location_id" : location .id ,
166+ "group_id" : group .id ,
167+ "release_status" : "draft" ,
168+ "name" : "Test Well with Measuring Point" ,
169+ "measuring_point_height" : 2.5 ,
170+ "measuring_point_description" : "top of casing" ,
171+ }
172+
173+ response = client .post ("/thing/water-well" , json = payload )
174+ assert response .status_code == 201
175+ data = response .json ()
176+
177+ assert data ["name" ] == payload ["name" ]
178+ assert data ["measuring_point_height" ] == 2.5
179+ assert data ["measuring_point_description" ] == "top of casing"
180+
181+ cleanup_post_test (Thing , data ["id" ])
182+
183+
155184@pytest .mark .skip ("Needs to be updated per changes made from feature files" )
156185def test_add_water_well_409_bad_group_id (location ):
157186 bad_group_id = 9999
0 commit comments