diff --git a/src/openforms/prefill/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIPrefillPluginTests/ObjectsAPIPrefillPluginTests.test_prefill_values_happy_flow.yaml b/src/openforms/prefill/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIPrefillPluginTests/ObjectsAPIPrefillPluginTests.test_prefill_values_happy_flow.yaml index d69d558711..fb053cdd25 100644 --- a/src/openforms/prefill/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIPrefillPluginTests/ObjectsAPIPrefillPluginTests.test_prefill_values_happy_flow.yaml +++ b/src/openforms/prefill/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIPrefillPluginTests/ObjectsAPIPrefillPluginTests.test_prefill_values_happy_flow.yaml @@ -2,7 +2,7 @@ interactions: - request: body: '{"type": "http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48", "record": {"typeVersion": 3, "data": {"name": {"last.name": "My last name"}, - "age": 45, "bsn": "111222333"}, "startAt": "2024-11-05"}}' + "age": 45, "bsn": "111222333"}, "startAt": "2024-11-29"}}' headers: Accept: - '*/*' @@ -24,8 +24,8 @@ interactions: uri: http://localhost:8002/api/v2/objects response: body: - string: '{"url":"http://objects-web:8000/api/v2/objects/34aeaf6a-aec0-4c56-bcb3-cf0173f77446","uuid":"34aeaf6a-aec0-4c56-bcb3-cf0173f77446","type":"http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","record":{"index":1,"typeVersion":3,"data":{"name":{"last.name":"My - last name"},"age":45,"bsn":"111222333"},"geometry":null,"startAt":"2024-11-05","endAt":null,"registrationAt":"2024-11-05","correctionFor":null,"correctedBy":null}}' + string: '{"url":"http://objects-web:8000/api/v2/objects/2ec61245-a19a-4393-a953-fef7e3151de4","uuid":"2ec61245-a19a-4393-a953-fef7e3151de4","type":"http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","record":{"index":1,"typeVersion":3,"data":{"name":{"last.name":"My + last name"},"age":45,"bsn":"111222333"},"geometry":null,"startAt":"2024-11-29","endAt":null,"registrationAt":"2024-11-29","correctionFor":null,"correctedBy":null}}' headers: Allow: - GET, POST, HEAD, OPTIONS @@ -40,9 +40,9 @@ interactions: Cross-Origin-Opener-Policy: - same-origin Date: - - Tue, 05 Nov 2024 14:59:30 GMT + - Fri, 29 Nov 2024 09:14:40 GMT Location: - - http://localhost:8002/api/v2/objects/34aeaf6a-aec0-4c56-bcb3-cf0173f77446 + - http://localhost:8002/api/v2/objects/2ec61245-a19a-4393-a953-fef7e3151de4 Referrer-Policy: - same-origin Server: @@ -72,11 +72,11 @@ interactions: User-Agent: - python-requests/2.32.2 method: GET - uri: http://localhost:8002/api/v2/objects/34aeaf6a-aec0-4c56-bcb3-cf0173f77446 + uri: http://localhost:8002/api/v2/objects/2ec61245-a19a-4393-a953-fef7e3151de4 response: body: - string: '{"url":"http://objects-web:8000/api/v2/objects/34aeaf6a-aec0-4c56-bcb3-cf0173f77446","uuid":"34aeaf6a-aec0-4c56-bcb3-cf0173f77446","type":"http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","record":{"index":1,"typeVersion":3,"data":{"age":45,"bsn":"111222333","name":{"last.name":"My - last name"}},"geometry":null,"startAt":"2024-11-05","endAt":null,"registrationAt":"2024-11-05","correctionFor":null,"correctedBy":null}}' + string: '{"url":"http://objects-web:8000/api/v2/objects/2ec61245-a19a-4393-a953-fef7e3151de4","uuid":"2ec61245-a19a-4393-a953-fef7e3151de4","type":"http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","record":{"index":1,"typeVersion":3,"data":{"age":45,"bsn":"111222333","name":{"last.name":"My + last name"}},"geometry":null,"startAt":"2024-11-29","endAt":null,"registrationAt":"2024-11-29","correctionFor":null,"correctedBy":null}}' headers: Allow: - GET, PUT, PATCH, DELETE, HEAD, OPTIONS @@ -91,7 +91,7 @@ interactions: Cross-Origin-Opener-Policy: - same-origin Date: - - Tue, 05 Nov 2024 14:59:31 GMT + - Fri, 29 Nov 2024 09:14:40 GMT Referrer-Policy: - same-origin Server: @@ -121,11 +121,11 @@ interactions: User-Agent: - python-requests/2.32.2 method: GET - uri: http://localhost:8002/api/v2/objects/34aeaf6a-aec0-4c56-bcb3-cf0173f77446 + uri: http://localhost:8002/api/v2/objects/2ec61245-a19a-4393-a953-fef7e3151de4 response: body: - string: '{"url":"http://objects-web:8000/api/v2/objects/34aeaf6a-aec0-4c56-bcb3-cf0173f77446","uuid":"34aeaf6a-aec0-4c56-bcb3-cf0173f77446","type":"http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","record":{"index":1,"typeVersion":3,"data":{"age":45,"bsn":"111222333","name":{"last.name":"My - last name"}},"geometry":null,"startAt":"2024-11-05","endAt":null,"registrationAt":"2024-11-05","correctionFor":null,"correctedBy":null}}' + string: '{"url":"http://objects-web:8000/api/v2/objects/2ec61245-a19a-4393-a953-fef7e3151de4","uuid":"2ec61245-a19a-4393-a953-fef7e3151de4","type":"http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","record":{"index":1,"typeVersion":3,"data":{"age":45,"bsn":"111222333","name":{"last.name":"My + last name"}},"geometry":null,"startAt":"2024-11-29","endAt":null,"registrationAt":"2024-11-29","correctionFor":null,"correctedBy":null}}' headers: Allow: - GET, PUT, PATCH, DELETE, HEAD, OPTIONS @@ -140,7 +140,7 @@ interactions: Cross-Origin-Opener-Policy: - same-origin Date: - - Tue, 05 Nov 2024 14:59:31 GMT + - Fri, 29 Nov 2024 09:14:40 GMT Referrer-Policy: - same-origin Server: diff --git a/src/openforms/prefill/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIPrefillPluginTests/ObjectsAPIPrefillPluginTests.test_prefill_values_when_reference_not_found.yaml b/src/openforms/prefill/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIPrefillPluginTests/ObjectsAPIPrefillPluginTests.test_prefill_values_when_reference_not_found.yaml index d487947b3e..66891ed91d 100644 --- a/src/openforms/prefill/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIPrefillPluginTests/ObjectsAPIPrefillPluginTests.test_prefill_values_when_reference_not_found.yaml +++ b/src/openforms/prefill/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIPrefillPluginTests/ObjectsAPIPrefillPluginTests.test_prefill_values_when_reference_not_found.yaml @@ -33,55 +33,7 @@ interactions: Cross-Origin-Opener-Policy: - same-origin Date: - - Tue, 05 Nov 2024 15:01:56 GMT - Referrer-Policy: - - same-origin - Server: - - nginx/1.27.0 - Vary: - - origin - X-Content-Type-Options: - - nosniff - X-Frame-Options: - - DENY - status: - code: 404 - message: Not Found -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate, br - Authorization: - - Token 7657474c3d75f56ae0abd0d1bf7994b09964dca9 - Connection: - - keep-alive - Content-Crs: - - EPSG:4326 - User-Agent: - - python-requests/2.32.2 - method: GET - uri: http://localhost:8002/api/v2/objects/048a37ca-a602-4158-9e60-9f06f3e47e2a - response: - body: - string: '{"detail":"Not found."}' - headers: - Allow: - - GET, PUT, PATCH, DELETE, HEAD, OPTIONS - Connection: - - keep-alive - Content-Crs: - - EPSG:4326 - Content-Length: - - '23' - Content-Type: - - application/json - Cross-Origin-Opener-Policy: - - same-origin - Date: - - Tue, 05 Nov 2024 15:01:56 GMT + - Fri, 29 Nov 2024 09:14:40 GMT Referrer-Policy: - same-origin Server: diff --git a/src/openforms/prefill/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIPrefillPluginTests/ObjectsAPIPrefillPluginTests.test_prefill_values_when_reference_returns_empty_values.yaml b/src/openforms/prefill/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIPrefillPluginTests/ObjectsAPIPrefillPluginTests.test_prefill_values_when_reference_returns_empty_values.yaml index ff73d2e850..a38ebfe383 100644 --- a/src/openforms/prefill/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIPrefillPluginTests/ObjectsAPIPrefillPluginTests.test_prefill_values_when_reference_returns_empty_values.yaml +++ b/src/openforms/prefill/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIPrefillPluginTests/ObjectsAPIPrefillPluginTests.test_prefill_values_when_reference_returns_empty_values.yaml @@ -1,7 +1,7 @@ interactions: - request: body: '{"type": "http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48", - "record": {"typeVersion": 3, "data": {"bsn": "111222333"}, "startAt": "2024-11-05"}}' + "record": {"typeVersion": 3, "data": {"bsn": "111222333"}, "startAt": "2024-11-29"}}' headers: Accept: - '*/*' @@ -23,7 +23,7 @@ interactions: uri: http://localhost:8002/api/v2/objects response: body: - string: '{"url":"http://objects-web:8000/api/v2/objects/264ebc07-7cba-4ef4-8a3c-fbb802888145","uuid":"264ebc07-7cba-4ef4-8a3c-fbb802888145","type":"http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","record":{"index":1,"typeVersion":3,"data":{"bsn":"111222333"},"geometry":null,"startAt":"2024-11-05","endAt":null,"registrationAt":"2024-11-05","correctionFor":null,"correctedBy":null}}' + string: '{"url":"http://objects-web:8000/api/v2/objects/da42d72d-f1eb-45e4-bb66-8bee69964350","uuid":"da42d72d-f1eb-45e4-bb66-8bee69964350","type":"http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","record":{"index":1,"typeVersion":3,"data":{"bsn":"111222333"},"geometry":null,"startAt":"2024-11-29","endAt":null,"registrationAt":"2024-11-29","correctionFor":null,"correctedBy":null}}' headers: Allow: - GET, POST, HEAD, OPTIONS @@ -38,9 +38,9 @@ interactions: Cross-Origin-Opener-Policy: - same-origin Date: - - Tue, 05 Nov 2024 14:59:25 GMT + - Fri, 29 Nov 2024 09:14:40 GMT Location: - - http://localhost:8002/api/v2/objects/264ebc07-7cba-4ef4-8a3c-fbb802888145 + - http://localhost:8002/api/v2/objects/da42d72d-f1eb-45e4-bb66-8bee69964350 Referrer-Policy: - same-origin Server: @@ -70,10 +70,10 @@ interactions: User-Agent: - python-requests/2.32.2 method: GET - uri: http://localhost:8002/api/v2/objects/264ebc07-7cba-4ef4-8a3c-fbb802888145 + uri: http://localhost:8002/api/v2/objects/da42d72d-f1eb-45e4-bb66-8bee69964350 response: body: - string: '{"url":"http://objects-web:8000/api/v2/objects/264ebc07-7cba-4ef4-8a3c-fbb802888145","uuid":"264ebc07-7cba-4ef4-8a3c-fbb802888145","type":"http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","record":{"index":1,"typeVersion":3,"data":{"bsn":"111222333"},"geometry":null,"startAt":"2024-11-05","endAt":null,"registrationAt":"2024-11-05","correctionFor":null,"correctedBy":null}}' + string: '{"url":"http://objects-web:8000/api/v2/objects/da42d72d-f1eb-45e4-bb66-8bee69964350","uuid":"da42d72d-f1eb-45e4-bb66-8bee69964350","type":"http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","record":{"index":1,"typeVersion":3,"data":{"bsn":"111222333"},"geometry":null,"startAt":"2024-11-29","endAt":null,"registrationAt":"2024-11-29","correctionFor":null,"correctedBy":null}}' headers: Allow: - GET, PUT, PATCH, DELETE, HEAD, OPTIONS @@ -88,7 +88,7 @@ interactions: Cross-Origin-Opener-Policy: - same-origin Date: - - Tue, 05 Nov 2024 14:59:25 GMT + - Fri, 29 Nov 2024 09:14:40 GMT Referrer-Policy: - same-origin Server: @@ -118,10 +118,10 @@ interactions: User-Agent: - python-requests/2.32.2 method: GET - uri: http://localhost:8002/api/v2/objects/264ebc07-7cba-4ef4-8a3c-fbb802888145 + uri: http://localhost:8002/api/v2/objects/da42d72d-f1eb-45e4-bb66-8bee69964350 response: body: - string: '{"url":"http://objects-web:8000/api/v2/objects/264ebc07-7cba-4ef4-8a3c-fbb802888145","uuid":"264ebc07-7cba-4ef4-8a3c-fbb802888145","type":"http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","record":{"index":1,"typeVersion":3,"data":{"bsn":"111222333"},"geometry":null,"startAt":"2024-11-05","endAt":null,"registrationAt":"2024-11-05","correctionFor":null,"correctedBy":null}}' + string: '{"url":"http://objects-web:8000/api/v2/objects/da42d72d-f1eb-45e4-bb66-8bee69964350","uuid":"da42d72d-f1eb-45e4-bb66-8bee69964350","type":"http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","record":{"index":1,"typeVersion":3,"data":{"bsn":"111222333"},"geometry":null,"startAt":"2024-11-29","endAt":null,"registrationAt":"2024-11-29","correctionFor":null,"correctedBy":null}}' headers: Allow: - GET, PUT, PATCH, DELETE, HEAD, OPTIONS @@ -136,7 +136,7 @@ interactions: Cross-Origin-Opener-Policy: - same-origin Date: - - Tue, 05 Nov 2024 14:59:25 GMT + - Fri, 29 Nov 2024 09:14:40 GMT Referrer-Policy: - same-origin Server: diff --git a/src/openforms/prefill/contrib/objects_api/tests/test_prefill.py b/src/openforms/prefill/contrib/objects_api/tests/test_prefill.py index 7ecaa8e3c8..81b909a012 100644 --- a/src/openforms/prefill/contrib/objects_api/tests/test_prefill.py +++ b/src/openforms/prefill/contrib/objects_api/tests/test_prefill.py @@ -1,6 +1,8 @@ from pathlib import Path from unittest.mock import patch +from django.core.exceptions import PermissionDenied + from rest_framework.test import APITestCase from openforms.authentication.service import AuthAttribute @@ -138,7 +140,8 @@ def test_prefill_values_when_reference_not_found(self): }, ) - prefill_variables(submission=submission) + with self.assertRaises(PermissionDenied): + prefill_variables(submission=submission) state = submission.load_submission_value_variables_state() self.assertEqual(TimelineLogProxy.objects.count(), 1)