File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -214,11 +214,18 @@ def test_empty_payload(rest_client):
214214 assert "No payload provided" in json .loads (response .data )["message" ]
215215
216216
217- def test_invalid_content_type (rest_client ):
218- """Test that non-JSON content type is rejected """
217+ def test_validate_tracer_analysis_payload_failure (rest_client ):
218+ """Test handling of invalid payload from validate_tracer_analysis_payload """
219219 response = rest_client .post (
220220 "/us/tracer-analysis" ,
221- data = "some data" ,
222- content_type = "text/plain" , # Invalid content type
221+ json = {
222+ # Missing required field 'variable'
223+ "household_id" : VALID_HOUSEHOLD_ID ,
224+ "policy_id" : VALID_POLICY_ID ,
225+ },
226+ )
227+ assert response .status_code == 400
228+ assert (
229+ "Missing required key: variable"
230+ in json .loads (response .data )["message" ]
223231 )
224- assert response .status_code == 415
You can’t perform that action at this time.
0 commit comments