Skip to content

Commit

Permalink
✅ [#4398] Re-record VCR cassettes for Objects API prefill
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbal committed Nov 29, 2024
1 parent 9b00dbc commit 918cdcd
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
- '*/*'
Expand All @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
- '*/*'
Expand All @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 918cdcd

Please sign in to comment.