diff --git a/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIPaymentStatusUpdateV2Tests/ObjectsAPIPaymentStatusUpdateV2Tests.test_update_payment_status.yaml b/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIPaymentStatusUpdateV2Tests/ObjectsAPIPaymentStatusUpdateV2Tests.test_update_payment_status.yaml index 865d837e8c..b0bbd0d09e 100644 --- a/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIPaymentStatusUpdateV2Tests/ObjectsAPIPaymentStatusUpdateV2Tests.test_update_payment_status.yaml +++ b/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIPaymentStatusUpdateV2Tests/ObjectsAPIPaymentStatusUpdateV2Tests.test_update_payment_status.yaml @@ -3,8 +3,9 @@ interactions: body: '{"type": "http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48", "record": {"typeVersion": 3, "data": {"age": 20, "name": {"last.name": "My last name"}, "submission_pdf_url": "http://example.com", "submission_csv_url": "http://example.com", - "submission_payment_completed": false, "submission_payment_amount": "0", "submission_payment_public_ids": - [], "submission_date": "2020-02-02T00:00:00+00:00"}, "startAt": "2020-02-02"}}' + "submission_payment_completed": false, "nested": {"unrelated": "some_value", + "submission_payment_amount": 0}, "submission_payment_public_ids": [], "submission_date": + "2020-02-02T00:00:00+00:00"}, "startAt": "2020-02-02"}}' headers: Accept: - '*/*' @@ -17,7 +18,7 @@ interactions: Content-Crs: - EPSG:4326 Content-Length: - - '456' + - '493' Content-Type: - application/json User-Agent: @@ -26,21 +27,21 @@ interactions: uri: http://localhost:8002/api/v2/objects response: body: - string: '{"url":"http://localhost:8002/api/v2/objects/2c287cd4-7737-473d-84de-8b0a018a46bb","uuid":"2c287cd4-7737-473d-84de-8b0a018a46bb","type":"http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","record":{"index":1,"typeVersion":3,"data":{"age":20,"name":{"last.name":"My - last name"},"submission_pdf_url":"http://example.com","submission_csv_url":"http://example.com","submission_payment_completed":false,"submission_payment_amount":"0","submission_payment_public_ids":[],"submission_date":"2020-02-02T00:00:00+00:00"},"geometry":null,"startAt":"2020-02-02","endAt":null,"registrationAt":"2024-03-19","correctionFor":null,"correctedBy":null}}' + string: '{"url":"http://localhost:8002/api/v2/objects/302d84d5-b428-4e6b-8fb5-9127a893fd5e","uuid":"302d84d5-b428-4e6b-8fb5-9127a893fd5e","type":"http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","record":{"index":1,"typeVersion":3,"data":{"age":20,"name":{"last.name":"My + last name"},"submission_pdf_url":"http://example.com","submission_csv_url":"http://example.com","submission_payment_completed":false,"nested":{"unrelated":"some_value","submission_payment_amount":0},"submission_payment_public_ids":[],"submission_date":"2020-02-02T00:00:00+00:00"},"geometry":null,"startAt":"2020-02-02","endAt":null,"registrationAt":"2024-03-22","correctionFor":null,"correctedBy":null}}' headers: Allow: - GET, POST, HEAD, OPTIONS Content-Crs: - EPSG:4326 Content-Length: - - '669' + - '703' Content-Type: - application/json Cross-Origin-Opener-Policy: - same-origin Location: - - http://localhost:8002/api/v2/objects/2c287cd4-7737-473d-84de-8b0a018a46bb + - http://localhost:8002/api/v2/objects/302d84d5-b428-4e6b-8fb5-9127a893fd5e Referrer-Policy: - same-origin X-Content-Type-Options: @@ -52,11 +53,9 @@ interactions: message: Created - request: body: '{"type": "http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48", - "record": {"typeVersion": 3, "data": {"age": 20, "name": {"last.name": "My last - name"}, "submission_date": "2020-02-02T00:00:00+00:00", "submission_pdf_url": - "", "submission_csv_url": "", "submission_payment_completed": true, "submission_payment_amount": - "10.01", "submission_payment_public_ids": ["TEST-123"]}, "startAt": "2020-02-02", - "geometry": {"type": "Point", "coordinates": [52.36673378967122, 4.893164274470299]}}}' + "record": {"typeVersion": 3, "data": {"submission_payment_completed": true, + "nested": {"submission_payment_amount": 10.01}, "submission_payment_public_ids": + ["TEST-123"]}, "startAt": "2020-02-02"}}' headers: Accept: - '*/*' @@ -69,24 +68,24 @@ interactions: Content-Crs: - EPSG:4326 Content-Length: - - '519' + - '293' Content-Type: - application/json User-Agent: - python-requests/2.31.0 - method: PUT - uri: http://localhost:8002/api/v2/objects/2c287cd4-7737-473d-84de-8b0a018a46bb + method: PATCH + uri: http://localhost:8002/api/v2/objects/302d84d5-b428-4e6b-8fb5-9127a893fd5e response: body: - string: '{"url":"http://localhost:8002/api/v2/objects/2c287cd4-7737-473d-84de-8b0a018a46bb","uuid":"2c287cd4-7737-473d-84de-8b0a018a46bb","type":"http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","record":{"index":2,"typeVersion":3,"data":{"age":20,"name":{"last.name":"My - last name"},"submission_date":"2020-02-02T00:00:00+00:00","submission_pdf_url":"","submission_csv_url":"","submission_payment_completed":true,"submission_payment_amount":"10.01","submission_payment_public_ids":["TEST-123"]},"geometry":{"type":"Point","coordinates":[52.36673378967122,4.893164274470299]},"startAt":"2020-02-02","endAt":null,"registrationAt":"2024-03-19","correctionFor":null,"correctedBy":null}}' + string: '{"url":"http://localhost:8002/api/v2/objects/302d84d5-b428-4e6b-8fb5-9127a893fd5e","uuid":"302d84d5-b428-4e6b-8fb5-9127a893fd5e","type":"http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","record":{"index":2,"typeVersion":3,"data":{"age":20,"name":{"last.name":"My + last name"},"nested":{"unrelated":"some_value","submission_payment_amount":10.01},"submission_date":"2020-02-02T00:00:00+00:00","submission_csv_url":"http://example.com","submission_pdf_url":"http://example.com","submission_payment_completed":true,"submission_payment_public_ids":["TEST-123"]},"geometry":null,"startAt":"2020-02-02","endAt":null,"registrationAt":"2024-03-22","correctionFor":null,"correctedBy":null}}' headers: Allow: - GET, PUT, PATCH, DELETE, HEAD, OPTIONS Content-Crs: - EPSG:4326 Content-Length: - - '710' + - '716' Content-Type: - application/json Cross-Origin-Opener-Policy: diff --git a/src/openforms/registrations/contrib/objects_api/tests/test_update_payment_status_v2.py b/src/openforms/registrations/contrib/objects_api/tests/test_update_payment_status_v2.py index fded17a157..c18303064f 100644 --- a/src/openforms/registrations/contrib/objects_api/tests/test_update_payment_status_v2.py +++ b/src/openforms/registrations/contrib/objects_api/tests/test_update_payment_status_v2.py @@ -61,7 +61,10 @@ def test_update_payment_status(self): "submission_pdf_url": "http://example.com", "submission_csv_url": "http://example.com", "submission_payment_completed": False, - "submission_payment_amount": "0", + "nested": { + "unrelated": "some_value", + "submission_payment_amount": 0, + }, "submission_payment_public_ids": [], "submission_date": timezone.now().isoformat(), }, @@ -137,7 +140,7 @@ def test_update_payment_status(self): }, { "variable_key": "payment_amount", - "target_path": ["submission_payment_amount"], + "target_path": ["nested", "submission_payment_amount"], }, { "variable_key": "payment_public_order_ids", @@ -164,5 +167,11 @@ def test_update_payment_status(self): result_data = result["record"]["data"] self.assertTrue(result_data["submission_payment_completed"]) - self.assertEqual(result_data["submission_payment_amount"], "10.01") + self.assertEqual( + result_data["nested"], + { + "unrelated": "some_value", + "submission_payment_amount": 10.01, + }, + ) self.assertEqual(result_data["submission_payment_public_ids"], ["TEST-123"])