Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#4267] Convert Objects API V1 tests to VCR #4548

Merged
merged 3 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker/docker-compose.objects-apis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ services:
- open-forms-dev

objects-web:
image: maykinmedia/objects-api:${OBJECTS_VERSION:-2.3.2}
image: maykinmedia/objects-api:${OBJECTS_VERSION:-2.4.0}
environment: &objects_web_env
- DJANGO_SETINGS_MODULE=objects.conf.docker
- SECRET_KEY=${SECRET_KEY:-fgv=c0hz&tl*8*3m3893@m+1pstrvidc9e^5@fpspmg%cy$15d}
Expand Down
2 changes: 1 addition & 1 deletion docker/objects-apis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ docker compose -f docker-compose.objects-apis.yml run objecttypes-web \
python src/manage.py dumpdata \
--indent=4 \
--output /app/fixtures/objecttypes_api_fixtures.json \
core \
core.objecttype \
token
```

Expand Down
40 changes: 40 additions & 0 deletions docker/objects-apis/fixtures/objects_api_fixtures.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,24 @@
"_name": "Geo in data"
}
},
{
"model": "core.objecttype",
"pk": 4,
"fields": {
"service": 1,
"uuid": "644ab597-e88c-43c0-8321-f12113510b0e",
"_name": "Fieldset component"
}
},
{
"model": "core.objecttype",
"pk": 5,
"fields": {
"service": 1,
"uuid": "8faed0fa-7864-4409-aa6d-533a37616a9e",
"_name": "Accepts everything"
}
},
{
"model": "token.tokenauth",
"pk": 1,
Expand Down Expand Up @@ -73,6 +91,28 @@
"fields": null
}
},
{
"model": "token.permission",
"pk": 4,
"fields": {
"token_auth": 1,
"object_type": 4,
"mode": "read_and_write",
"use_fields": false,
"fields": null
}
},
{
"model": "token.permission",
"pk": 5,
"fields": {
"token_auth": 1,
"object_type": 5,
"mode": "read_and_write",
"use_fields": false,
"fields": null
}
},
{
"model": "zgw_consumers.service",
"pk": 1,
Expand Down
83 changes: 83 additions & 0 deletions docker/objects-apis/fixtures/objecttypes_api_fixtures.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,52 @@
"allow_geometry": true
}
},
{
"model": "core.objecttype",
"pk": 5,
"fields": {
"uuid": "644ab597-e88c-43c0-8321-f12113510b0e",
"name": "Fieldset component",
"name_plural": "Fieldset component",
"description": "",
"data_classification": "confidential",
"maintainer_organization": "",
"maintainer_department": "",
"contact_person": "",
"contact_email": "",
"source": "",
"update_frequency": "unknown",
"provider_organization": "",
"documentation_url": "",
"labels": {},
"created_at": "2024-02-08",
"modified_at": "2024-02-08",
"allow_geometry": true
}
},
{
"model": "core.objecttype",
"pk": 6,
"fields": {
"uuid": "8faed0fa-7864-4409-aa6d-533a37616a9e",
"name": "Accepts everything",
"name_plural": "Accepts everything",
"description": "",
"data_classification": "open",
"maintainer_organization": "",
"maintainer_department": "",
"contact_person": "",
"contact_email": "",
"source": "",
"update_frequency": "unknown",
"provider_organization": "",
"documentation_url": "",
"labels": {},
"created_at": "2024-07-22",
"modified_at": "2024-07-22",
"allow_geometry": true
}
},
{
"model": "core.objectversion",
"pk": 1,
Expand Down Expand Up @@ -306,6 +352,43 @@
"status": "published"
}
},
{
"model": "core.objectversion",
"pk": 7,
"fields": {
"object_type": 5,
"version": 1,
"created_at": "2024-02-08",
"modified_at": "2024-02-08",
"published_at": "2024-02-08",
"json_schema": {
"type": "object",
"title": "Fieldset component",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"textfield": {
"type": "string"
}
}
},
"status": "published"
}
},
{
"model": "core.objectversion",
"pk": 8,
"fields": {
"object_type": 6,
"version": 1,
"created_at": "2024-07-22",
"modified_at": "2024-07-22",
"published_at": null,
"json_schema": {
"type": "object"
},
"status": "draft"
}
},
{
"model": "token.tokenauth",
"pk": 1,
Expand Down
44 changes: 43 additions & 1 deletion docker/open-zaak/fixtures/open_zaak_fixtures.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"model": "catalogi.catalogus",
"pk": 2,
"fields": {
"_etag": "7236b46ee9fd8c1eb24dd69c2e5cd51c",
"_etag": "bed1ecff53402298e98e22eaa1756480",
"naam": "Test catalog 2",
"uuid": "630271f6-568a-485e-b1c4-4ed2d6ab3a58",
"domein": "OTHER",
Expand Down Expand Up @@ -181,6 +181,48 @@
"catalogus": 2
}
},
{
"model": "catalogi.informatieobjecttype",
"pk": 6,
"fields": {
"_etag": "971b792c4044f0924ee98aa262a2cad3",
"datum_begin_geldigheid": "2024-07-19",
"datum_einde_geldigheid": null,
"concept": false,
"uuid": "f2908f6f-aa07-42ef-8760-74c5234f2d25",
"omschrijving": "PDF Informatieobjecttype other catalog",
"informatieobjectcategorie": "Test category",
"trefwoord": "[]",
"vertrouwelijkheidaanduiding": "openbaar",
"omschrijving_generiek_informatieobjecttype": "",
"omschrijving_generiek_definitie": "",
"omschrijving_generiek_herkomst": "",
"omschrijving_generiek_hierarchie": "",
"omschrijving_generiek_opmerking": "",
"catalogus": 2
}
},
{
"model": "catalogi.informatieobjecttype",
"pk": 7,
"fields": {
"_etag": "34514f4c5c5d6d4d09a3ee40891a925e",
"datum_begin_geldigheid": "2024-07-19",
"datum_einde_geldigheid": null,
"concept": false,
"uuid": "cd6aeaf2-ca37-416f-b78c-1cc302f81a81",
"omschrijving": "Attachment Informatieobjecttype other catalog",
"informatieobjectcategorie": "Test category",
"trefwoord": "[]",
"vertrouwelijkheidaanduiding": "openbaar",
"omschrijving_generiek_informatieobjecttype": "",
"omschrijving_generiek_definitie": "",
"omschrijving_generiek_herkomst": "",
"omschrijving_generiek_hierarchie": "",
"omschrijving_generiek_opmerking": "",
"catalogus": 2
}
},
{
"model": "catalogi.zaaktypeinformatieobjecttype",
"pk": 1,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
interactions:
- request:
body: null
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate, br
Authorization:
- Token 171be5abaf41e7856b423ad513df1ef8f867ff48
Connection:
- keep-alive
User-Agent:
- python-requests/2.32.2
method: GET
uri: http://localhost:8001/api/v2/objecttypes/8faed0fa-7864-4409-aa6d-533a37616a9e
response:
body:
string: '{"url":"http://objecttypes-web:8000/api/v2/objecttypes/8faed0fa-7864-4409-aa6d-533a37616a9e","uuid":"8faed0fa-7864-4409-aa6d-533a37616a9e","name":"Accepts
everything","namePlural":"Accepts everything","description":"","dataClassification":"open","maintainerOrganization":"","maintainerDepartment":"","contactPerson":"","contactEmail":"","source":"","updateFrequency":"unknown","providerOrganization":"","documentationUrl":"","labels":{},"createdAt":"2024-07-22","modifiedAt":"2024-07-22","allowGeometry":true,"versions":["http://objecttypes-web:8000/api/v2/objecttypes/8faed0fa-7864-4409-aa6d-533a37616a9e/versions/1"]}'
headers:
Allow:
- GET, PUT, PATCH, DELETE, HEAD, OPTIONS
Connection:
- keep-alive
Content-Length:
- '619'
Content-Type:
- application/json
Cross-Origin-Opener-Policy:
- same-origin
Date:
- Tue, 23 Jul 2024 08:53:09 GMT
Referrer-Policy:
- same-origin
Server:
- nginx/1.27.0
Vary:
- origin
X-Content-Type-Options:
- nosniff
X-Frame-Options:
- DENY
status:
code: 200
message: OK
- request:
body: '{"type": "http://objecttypes-web:8000/api/v2/objecttypes/8faed0fa-7864-4409-aa6d-533a37616a9e",
"record": {"typeVersion": 1, "data": {"auth": {"source": "eherkenning", "levelOfAssurance":
"urn:etoegang:core:assurance-class:loa3", "representee": {"identifierType":
"bsn", "identifier": "999991607"}, "authorizee": {"legalSubject": {"identifierType":
"kvkNummer", "identifier": "90002768"}, "actingSubject": {"identifierType":
"opaque", "identifier": "4B75A0EA107B3D36C82FD675B5B78CC2F181B22E33D85F2D4A5DA63452EE3018@2D8FF1EF10279BC2643F376D89835151"}},
"mandate": {"role": "bewindvoerder", "services": [{"id": "urn:etoegang:DV:00000001002308836000:services:9113",
"uuid": "34085d78-21aa-4481-a219-b28d7f3282fc"}]}}}, "startAt": "2024-07-23"}}'
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate, br
Authorization:
- Token 7657474c3d75f56ae0abd0d1bf7994b09964dca9
Connection:
- keep-alive
Content-Crs:
- EPSG:4326
Content-Length:
- '741'
Content-Type:
- application/json
User-Agent:
- python-requests/2.32.2
method: POST
uri: http://localhost:8002/api/v2/objects
response:
body:
string: '{"url":"http://objects-web:8000/api/v2/objects/83fa03bb-959a-4f7d-bc14-c7d8f18539d5","uuid":"83fa03bb-959a-4f7d-bc14-c7d8f18539d5","type":"http://objecttypes-web:8000/api/v2/objecttypes/8faed0fa-7864-4409-aa6d-533a37616a9e","record":{"index":1,"typeVersion":1,"data":{"auth":{"source":"eherkenning","levelOfAssurance":"urn:etoegang:core:assurance-class:loa3","representee":{"identifierType":"bsn","identifier":"999991607"},"authorizee":{"legalSubject":{"identifierType":"kvkNummer","identifier":"90002768"},"actingSubject":{"identifierType":"opaque","identifier":"4B75A0EA107B3D36C82FD675B5B78CC2F181B22E33D85F2D4A5DA63452EE3018@2D8FF1EF10279BC2643F376D89835151"}},"mandate":{"role":"bewindvoerder","services":[{"id":"urn:etoegang:DV:00000001002308836000:services:9113","uuid":"34085d78-21aa-4481-a219-b28d7f3282fc"}]}}},"geometry":null,"startAt":"2024-07-23","endAt":null,"registrationAt":"2024-07-23","correctionFor":null,"correctedBy":null}}'
headers:
Allow:
- GET, POST, HEAD, OPTIONS
Connection:
- keep-alive
Content-Crs:
- EPSG:4326
Content-Length:
- '944'
Content-Type:
- application/json
Cross-Origin-Opener-Policy:
- same-origin
Date:
- Tue, 23 Jul 2024 08:53:09 GMT
Location:
- http://localhost:8002/api/v2/objects/83fa03bb-959a-4f7d-bc14-c7d8f18539d5
Referrer-Policy:
- same-origin
Server:
- nginx/1.27.0
Vary:
- origin
X-Content-Type-Options:
- nosniff
X-Frame-Options:
- DENY
status:
code: 201
message: Created
version: 1
Loading
Loading