From ee197c7ece26662c5d436a4428843ac4f54ca676 Mon Sep 17 00:00:00 2001 From: SilviaAmAm Date: Mon, 14 Oct 2024 15:25:23 +0200 Subject: [PATCH] :white_check_mark: [#397] Test zaak creation with VCR --- .../openzaak/fixtures/complex_relations.json | 98 +++++++ .../destruction/tests/factories.py | 7 + .../destruction/tests/test_tasks.py | 37 ++- ...rtTest.test_create_destruction_report.yaml | 253 ++++++++++++++++++ .../destruction/tests/vcr/test_models.py | 94 +++++++ 5 files changed, 485 insertions(+), 4 deletions(-) create mode 100644 backend/src/openarchiefbeheer/destruction/tests/vcr/cassettes/CreateDestructionReportTest.test_create_destruction_report.yaml create mode 100644 backend/src/openarchiefbeheer/destruction/tests/vcr/test_models.py diff --git a/backend/docker-services/openzaak/fixtures/complex_relations.json b/backend/docker-services/openzaak/fixtures/complex_relations.json index b4ceba06..f6487c21 100644 --- a/backend/docker-services/openzaak/fixtures/complex_relations.json +++ b/backend/docker-services/openzaak/fixtures/complex_relations.json @@ -658,5 +658,103 @@ "catalogus": 1, "deelzaaktypen": [] } +}, +{ + "model": "catalogi.informatieobjecttype", + "pk": 2, + "fields": { + "datum_begin_geldigheid": "2018-01-01", + "datum_einde_geldigheid": null, + "concept": false, + "uuid": "9dee6712-122e-464a-99a3-c16692de5485", + "omschrijving": "Destruction report type", + "informatieobjectcategorie": "stock", + "trefwoord": "[]", + "vertrouwelijkheidaanduiding": "openbaar", + "omschrijving_generiek_informatieobjecttype": "bill", + "omschrijving_generiek_definitie": "Destruction report type", + "omschrijving_generiek_herkomst": "ZSWuoDPOIaWF", + "omschrijving_generiek_hierarchie": "until", + "omschrijving_generiek_opmerking": "", + "catalogus": 1 + } +}, +{ + "model": "catalogi.zaaktypeinformatieobjecttype", + "pk": 2, + "fields": { + "uuid": "835af306-c038-42f5-8225-008628b6e3f8", + "zaaktype": 2, + "informatieobjecttype": 2, + "volgnummer": 1, + "richting": "inkomend", + "statustype": null + } +}, +{ + "model": "catalogi.zaaktype", + "pk": 2, + "fields": { + "datum_begin_geldigheid": "2018-01-01", + "datum_einde_geldigheid": null, + "concept": false, + "uuid": "ecd08880-5081-4d7a-afc3-ade1d6e6346f", + "identificatie": "ZAAKTYPE-2018-0000000002", + "zaaktype_omschrijving": "Destruction confirmation type", + "zaaktype_omschrijving_generiek": "", + "vertrouwelijkheidaanduiding": "", + "doel": "To confirm that a destruction list has been correctly processed.", + "aanleiding": "When a destructio list is processed by Open Archiefbeheer", + "toelichting": "", + "indicatie_intern_of_extern": "extern", + "handeling_initiator": "indienen", + "onderwerp": "Destruction", + "handeling_behandelaar": "uitvoeren", + "doorlooptijd_behandeling": "P30D", + "servicenorm_behandeling": null, + "opschorting_en_aanhouding_mogelijk": true, + "verlenging_mogelijk": false, + "verlengingstermijn": null, + "trefwoorden": "[]", + "publicatie_indicatie": true, + "publicatietekst": "", + "verantwoordingsrelatie": "[]", + "versiedatum": "2018-01-01", + "verantwoordelijke": "100000000", + "producten_of_diensten": "[\"https://example.com/product/123\"]", + "selectielijst_procestype": "https://selectielijst.openzaak.nl/api/v1/procestypen/c844637e-6393-4202-b030-e1bffb08a9b0", + "selectielijst_procestype_jaar": 2020, + "referentieproces_naam": "ReferentieProces 0", + "referentieproces_link": "", + "broncatalogus_url": "", + "broncatalogus_domein": "", + "broncatalogus_rsin": "", + "bronzaaktype_url": "", + "bronzaaktype_identificatie": "", + "bronzaaktype_omschrijving": "", + "catalogus": 1, + "deelzaaktypen": [] + } +}, +{ + "model": "catalogi.statustype", + "pk": 1, + "fields": { + "uuid": "835a2a13-f52f-4339-83e5-b7250e5ad016", + "statustype_omschrijving": "Statustype for destruction report zaak", + "statustypevolgnummer": 1, + "zaaktype": 2 + } +}, +{ + "model": "catalogi.resultaattype", + "pk": 1, + "fields": { + "uuid": "5d39b8ac-437a-475c-9a76-0f6ae1540d0e", + "omschrijving": "Destruction report zaak", + "resultaattypeomschrijving": "Destruction report zaak", + "selectielijstklasse": "https://selectielijst.openzaak.nl/api/v1/resultaten/1bb001e9-5eab-4f10-8940-8781e11f180f", + "zaaktype": 2 + } } ] diff --git a/backend/src/openarchiefbeheer/destruction/tests/factories.py b/backend/src/openarchiefbeheer/destruction/tests/factories.py index 8df064e0..412f8585 100644 --- a/backend/src/openarchiefbeheer/destruction/tests/factories.py +++ b/backend/src/openarchiefbeheer/destruction/tests/factories.py @@ -18,6 +18,13 @@ class Meta: model = "destruction.DestructionList" django_get_or_create = ("name",) + class Params: + with_report = factory.Trait( + destruction_report=factory.django.FileField( + data=b"some data", filename="report.csv" + ), + ) + @post_generation def post(destruction_list, create, extracted, **kwargs): if not create: diff --git a/backend/src/openarchiefbeheer/destruction/tests/test_tasks.py b/backend/src/openarchiefbeheer/destruction/tests/test_tasks.py index 5d5d04e7..c4ea74df 100644 --- a/backend/src/openarchiefbeheer/destruction/tests/test_tasks.py +++ b/backend/src/openarchiefbeheer/destruction/tests/test_tasks.py @@ -263,9 +263,18 @@ def test_process_list(self): destruction_list=destruction_list, ) - with patch( - "openarchiefbeheer.destruction.models.delete_zaak_and_related_objects" - ) as m_delete: + with ( + patch( + "openarchiefbeheer.destruction.models.delete_zaak_and_related_objects" + ) as m_delete, + patch( + "openarchiefbeheer.destruction.utils.create_zaak_for_report" + ) as m_zaak, + patch( + "openarchiefbeheer.destruction.utils.create_eio_destruction_report" + ) as m_eio, + patch("openarchiefbeheer.destruction.utils.attach_report_to_zaak") as m_zio, + ): delete_destruction_list(destruction_list) destruction_list.refresh_from_db() @@ -324,6 +333,10 @@ def test_process_list(self): b"http://zaken.nl/api/v1/zaken/222-222-222,2022-01-02,http://zaken.nl/api/v1/resultaten/111-111-222,2020-01-02,Test description 2,ZAAK-02,http://catalogue-api.nl/zaaktypen/111-111-111,Aangifte behandelen,1\n", ) + m_zaak.assert_called() + m_eio.assert_called() + m_zio.assert_called() + @log_capture(level=logging.INFO) def test_item_skipped_if_already_succeeded(self, logs): item = DestructionListItemFactory.create( @@ -358,6 +371,13 @@ def test_processing_list_with_failed_item(self): patch( "openarchiefbeheer.destruction.models.delete_zaak_and_related_objects", ), + patch( + "openarchiefbeheer.destruction.utils.create_zaak_for_report" + ) as m_zaak, + patch( + "openarchiefbeheer.destruction.utils.create_eio_destruction_report" + ) as m_eio, + patch("openarchiefbeheer.destruction.utils.attach_report_to_zaak") as m_zio, ): delete_destruction_list(destruction_list) @@ -371,9 +391,18 @@ def test_processing_list_with_failed_item(self): self.assertEqual(item.processing_status, InternalStatus.succeeded) self.assertEqual( item.internal_results, - {"deleted_resources": {}, "resources_to_delete": {}, "traceback": ""}, + { + "deleted_resources": {}, + "resources_to_delete": {}, + "traceback": "", + "created_resources": {}, + }, ) + m_zaak.assert_called() + m_eio.assert_called() + m_zio.assert_called() + def test_complete_and_notify(self): destruction_list = DestructionListFactory.create( name="Some destruction list", diff --git a/backend/src/openarchiefbeheer/destruction/tests/vcr/cassettes/CreateDestructionReportTest.test_create_destruction_report.yaml b/backend/src/openarchiefbeheer/destruction/tests/vcr/cassettes/CreateDestructionReportTest.test_create_destruction_report.yaml new file mode 100644 index 00000000..38731194 --- /dev/null +++ b/backend/src/openarchiefbeheer/destruction/tests/vcr/cassettes/CreateDestructionReportTest.test_create_destruction_report.yaml @@ -0,0 +1,253 @@ +interactions: +- request: + body: '{"bronorganisatie": "000000000", "omschrijving": "Destruction report of + list: trouble", "zaaktype": "http://localhost:8003/catalogi/api/v1/zaaktypen/ecd08880-5081-4d7a-afc3-ade1d6e6346f", + "vertrouwelijkheidaanduiding": "openbaar", "startdatum": "2024-10-14", "verantwoordelijkeOrganisatie": + "000000000", "archiefnominatie": "blijvend_bewaren"}' + headers: + Accept: + - '*/*' + Accept-Crs: + - EPSG:4326 + Accept-Encoding: + - gzip, deflate + Authorization: + - Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ0ZXN0LXZjciIsImlhdCI6MTcyODkxMTU4NCwiY2xpZW50X2lkIjoidGVzdC12Y3IiLCJ1c2VyX2lkIjoiIiwidXNlcl9yZXByZXNlbnRhdGlvbiI6IiJ9.YVaTGvQZgvrO29jhKF5MqrqSE80OGgjgMfo417Tgj44 + Connection: + - keep-alive + Content-Crs: + - EPSG:4326 + Content-Length: + - '343' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: http://localhost:8003/zaken/api/v1/zaken + response: + body: + string: '{"url":"http://localhost:8003/zaken/api/v1/zaken/d2762871-fd55-4c72-9748-e8e2d745c6a6","uuid":"d2762871-fd55-4c72-9748-e8e2d745c6a6","identificatie":"ZAAK-2024-0000000009","bronorganisatie":"000000000","omschrijving":"Destruction + report of list: trouble","toelichting":"","zaaktype":"http://localhost:8003/catalogi/api/v1/zaaktypen/ecd08880-5081-4d7a-afc3-ade1d6e6346f","registratiedatum":"2024-10-14","verantwoordelijkeOrganisatie":"000000000","startdatum":"2024-10-14","einddatum":null,"einddatumGepland":null,"uiterlijkeEinddatumAfdoening":null,"publicatiedatum":null,"communicatiekanaal":"","communicatiekanaalNaam":"","productenOfDiensten":[],"vertrouwelijkheidaanduiding":"openbaar","betalingsindicatie":"","betalingsindicatieWeergave":"","laatsteBetaaldatum":null,"zaakgeometrie":null,"verlenging":null,"opschorting":{"indicatie":false,"reden":""},"selectielijstklasse":"","hoofdzaak":null,"deelzaken":[],"relevanteAndereZaken":[],"eigenschappen":[],"rollen":[],"status":null,"zaakinformatieobjecten":[],"zaakobjecten":[],"kenmerken":[],"archiefnominatie":"blijvend_bewaren","archiefstatus":"nog_te_archiveren","archiefactiedatum":null,"resultaat":null,"opdrachtgevendeOrganisatie":"","processobjectaard":"","startdatumBewaartermijn":null,"processobject":{"datumkenmerk":"","identificatie":"","objecttype":"","registratie":""}}' + headers: + API-version: + - 1.5.1 + Allow: + - GET, POST, HEAD, OPTIONS + Content-Crs: + - EPSG:4326 + Content-Length: + - '1334' + Content-Type: + - application/json + Cross-Origin-Opener-Policy: + - same-origin + Location: + - http://localhost:8003/zaken/api/v1/zaken/d2762871-fd55-4c72-9748-e8e2d745c6a6 + Referrer-Policy: + - same-origin + Vary: + - origin + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + status: + code: 201 + message: Created +- request: + body: '{"zaak": "http://localhost:8003/zaken/api/v1/zaken/d2762871-fd55-4c72-9748-e8e2d745c6a6", + "resultaattype": "http://localhost:8003/catalogi/api/v1/resultaattypen/5d39b8ac-437a-475c-9a76-0f6ae1540d0e"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ0ZXN0LXZjciIsImlhdCI6MTcyODkxMTU4NCwiY2xpZW50X2lkIjoidGVzdC12Y3IiLCJ1c2VyX2lkIjoiIiwidXNlcl9yZXByZXNlbnRhdGlvbiI6IiJ9.YVaTGvQZgvrO29jhKF5MqrqSE80OGgjgMfo417Tgj44 + Connection: + - keep-alive + Content-Length: + - '199' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: http://localhost:8003/zaken/api/v1/resultaten + response: + body: + string: '{"url":"http://localhost:8003/zaken/api/v1/resultaten/750619bf-4eeb-4d81-8d5f-ceda31547645","uuid":"750619bf-4eeb-4d81-8d5f-ceda31547645","zaak":"http://localhost:8003/zaken/api/v1/zaken/d2762871-fd55-4c72-9748-e8e2d745c6a6","resultaattype":"http://localhost:8003/catalogi/api/v1/resultaattypen/5d39b8ac-437a-475c-9a76-0f6ae1540d0e","toelichting":""}' + headers: + API-version: + - 1.5.1 + Allow: + - GET, POST, HEAD, OPTIONS + Content-Length: + - '350' + Content-Type: + - application/json + Cross-Origin-Opener-Policy: + - same-origin + Location: + - http://localhost:8003/zaken/api/v1/resultaten/750619bf-4eeb-4d81-8d5f-ceda31547645 + Referrer-Policy: + - same-origin + Vary: + - Accept, origin + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + status: + code: 201 + message: Created +- request: + body: '{"zaak": "http://localhost:8003/zaken/api/v1/zaken/d2762871-fd55-4c72-9748-e8e2d745c6a6", + "statustype": "http://localhost:8003/catalogi/api/v1/statustypen/835a2a13-f52f-4339-83e5-b7250e5ad016", + "datum_status_gezet": "2024-10-14"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ0ZXN0LXZjciIsImlhdCI6MTcyODkxMTU4NCwiY2xpZW50X2lkIjoidGVzdC12Y3IiLCJ1c2VyX2lkIjoiIiwidXNlcl9yZXByZXNlbnRhdGlvbiI6IiJ9.YVaTGvQZgvrO29jhKF5MqrqSE80OGgjgMfo417Tgj44 + Connection: + - keep-alive + Content-Length: + - '229' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: http://localhost:8003/zaken/api/v1/statussen + response: + body: + string: '{"url":"http://localhost:8003/zaken/api/v1/statussen/633da83a-3e82-48e4-8080-efeff2491d2d","uuid":"633da83a-3e82-48e4-8080-efeff2491d2d","zaak":"http://localhost:8003/zaken/api/v1/zaken/d2762871-fd55-4c72-9748-e8e2d745c6a6","statustype":"http://localhost:8003/catalogi/api/v1/statustypen/835a2a13-f52f-4339-83e5-b7250e5ad016","datumStatusGezet":"2024-10-14T00:00:00Z","statustoelichting":"","indicatieLaatstGezetteStatus":true,"gezetdoor":null,"zaakinformatieobjecten":[]}' + headers: + API-version: + - 1.5.1 + Allow: + - GET, POST, HEAD, OPTIONS + Content-Length: + - '472' + Content-Type: + - application/json + Cross-Origin-Opener-Policy: + - same-origin + Location: + - http://localhost:8003/zaken/api/v1/statussen/633da83a-3e82-48e4-8080-efeff2491d2d + Referrer-Policy: + - same-origin + Vary: + - Accept, origin + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + status: + code: 201 + message: Created +- request: + body: '{"bronorganisatie": "000000000", "creatiedatum": "2024-10-14", "titel": + "Destruction report of list: trouble", "auteur": "Open Archiefbeheer", "taal": + "nld", "formaat": "text/csv", "inhoud": "c29tZSBkYXRh", "informatieobjecttype": + "http://localhost:8003/catalogi/api/v1/informatieobjecttypen/9dee6712-122e-464a-99a3-c16692de5485", + "indicatie_gebruiksrecht": false}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ0ZXN0LXZjciIsImlhdCI6MTcyODkxMTU4NSwiY2xpZW50X2lkIjoidGVzdC12Y3IiLCJ1c2VyX2lkIjoiIiwidXNlcl9yZXByZXNlbnRhdGlvbiI6IiJ9.GiFPqw7fhIeXmXEAD4tAqrjZwWxjpft7mFle0vvMZtk + Connection: + - keep-alive + Content-Length: + - '364' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten + response: + body: + string: '{"url":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/174fc1c3-36fe-4ed1-b2c4-b0368efa2008","identificatie":"DOCUMENT-2024-0000000003","bronorganisatie":"000000000","creatiedatum":"2024-10-14","titel":"Destruction + report of list: trouble","vertrouwelijkheidaanduiding":"openbaar","auteur":"Open + Archiefbeheer","status":"","formaat":"text/csv","taal":"nld","versie":1,"beginRegistratie":"2024-10-14T13:13:05.150793Z","bestandsnaam":"","inhoud":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/174fc1c3-36fe-4ed1-b2c4-b0368efa2008/download?versie=1","bestandsomvang":9,"link":"","beschrijving":"","ontvangstdatum":null,"verzenddatum":null,"indicatieGebruiksrecht":false,"verschijningsvorm":"","ondertekening":{"soort":"","datum":null},"integriteit":{"algoritme":"","waarde":"","datum":null},"informatieobjecttype":"http://localhost:8003/catalogi/api/v1/informatieobjecttypen/9dee6712-122e-464a-99a3-c16692de5485","locked":false,"bestandsdelen":[],"trefwoorden":[],"lock":""}' + headers: + API-version: + - 1.4.2 + Allow: + - GET, POST, HEAD, OPTIONS + Content-Length: + - '1018' + Content-Type: + - application/json + Cross-Origin-Opener-Policy: + - same-origin + Location: + - http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/174fc1c3-36fe-4ed1-b2c4-b0368efa2008 + Referrer-Policy: + - same-origin + Vary: + - origin + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + status: + code: 201 + message: Created +- request: + body: '{"zaak": "http://localhost:8003/zaken/api/v1/zaken/d2762871-fd55-4c72-9748-e8e2d745c6a6", + "informatieobject": "http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/174fc1c3-36fe-4ed1-b2c4-b0368efa2008"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Authorization: + - Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ0ZXN0LXZjciIsImlhdCI6MTcyODkxMTU4NSwiY2xpZW50X2lkIjoidGVzdC12Y3IiLCJ1c2VyX2lkIjoiIiwidXNlcl9yZXByZXNlbnRhdGlvbiI6IiJ9.GiFPqw7fhIeXmXEAD4tAqrjZwWxjpft7mFle0vvMZtk + Connection: + - keep-alive + Content-Length: + - '219' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.3 + method: POST + uri: http://localhost:8003/zaken/api/v1/zaakinformatieobjecten + response: + body: + string: '{"url":"http://localhost:8003/zaken/api/v1/zaakinformatieobjecten/c7cd732c-8e62-49c2-88ea-e9c888e7a9e7","uuid":"c7cd732c-8e62-49c2-88ea-e9c888e7a9e7","informatieobject":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/174fc1c3-36fe-4ed1-b2c4-b0368efa2008","zaak":"http://localhost:8003/zaken/api/v1/zaken/d2762871-fd55-4c72-9748-e8e2d745c6a6","aardRelatieWeergave":"Hoort + bij, omgekeerd: kent","titel":"","beschrijving":"","registratiedatum":"2024-10-14T13:13:05.230541Z","vernietigingsdatum":null,"status":null}' + headers: + API-version: + - 1.5.1 + Allow: + - GET, POST, HEAD, OPTIONS + Content-Length: + - '534' + Content-Type: + - application/json + Cross-Origin-Opener-Policy: + - same-origin + Location: + - http://localhost:8003/zaken/api/v1/zaakinformatieobjecten/c7cd732c-8e62-49c2-88ea-e9c888e7a9e7 + Referrer-Policy: + - same-origin + Vary: + - Accept, origin + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + status: + code: 201 + message: Created +version: 1 diff --git a/backend/src/openarchiefbeheer/destruction/tests/vcr/test_models.py b/backend/src/openarchiefbeheer/destruction/tests/vcr/test_models.py new file mode 100644 index 00000000..68cdbca3 --- /dev/null +++ b/backend/src/openarchiefbeheer/destruction/tests/vcr/test_models.py @@ -0,0 +1,94 @@ +from unittest.mock import patch + +from django.test import TestCase, tag + +from privates.test import temp_private_root +from vcr.unittest import VCRMixin +from zgw_consumers.constants import APITypes +from zgw_consumers.test.factories import ServiceFactory + +from openarchiefbeheer.config.models import ArchiveConfig +from openarchiefbeheer.utils.results_store import ResultStore + +from ...constants import InternalStatus, ListStatus +from ..factories import DestructionListFactory + + +@tag("vcr") +@temp_private_root() +class CreateDestructionReportTest(VCRMixin, TestCase): + @classmethod + def setUpClass(cls) -> None: + super().setUpClass() + + cls.zrc_service = ServiceFactory.create( + api_type=APITypes.zrc, + api_root="http://localhost:8003/zaken/api/v1", + client_id="test-vcr", + secret="test-vcr", + ) + cls.drc_service = ServiceFactory.create( + api_type=APITypes.drc, + api_root="http://localhost:8003/documenten/api/v1", + client_id="test-vcr", + secret="test-vcr", + ) + cls.ztc_service = ServiceFactory.create( + api_type=APITypes.ztc, + api_root="http://localhost:8003/catalogi/api/v1", + client_id="test-vcr", + secret="test-vcr", + ) + + def test_create_destruction_report(self): + destruction_list = DestructionListFactory.create( + processing_status=InternalStatus.new, + status=ListStatus.deleted, + with_report=True, + ) + + with patch( + "openarchiefbeheer.destruction.utils.ArchiveConfig.get_solo", + return_value=ArchiveConfig( + bronorganisatie="000000000", + zaaktype="http://localhost:8003/catalogi/api/v1/zaaktypen/ecd08880-5081-4d7a-afc3-ade1d6e6346f", + statustype="http://localhost:8003/catalogi/api/v1/statustypen/835a2a13-f52f-4339-83e5-b7250e5ad016", + resultaattype="http://localhost:8003/catalogi/api/v1/resultaattypen/5d39b8ac-437a-475c-9a76-0f6ae1540d0e", + informatieobjecttype="http://localhost:8003/catalogi/api/v1/informatieobjecttypen/9dee6712-122e-464a-99a3-c16692de5485", + ), + ): + destruction_list.create_report_zaak() + + destruction_list.refresh_from_db() + + self.assertEqual( + destruction_list.zaak_destruction_report_url, + "http://localhost:8003/zaken/api/v1/zaken/d2762871-fd55-4c72-9748-e8e2d745c6a6", + ) + + store = ResultStore(destruction_list) + + self.assertEqual( + store.get_created_resources("resultaten"), + [ + "http://localhost:8003/zaken/api/v1/resultaten/750619bf-4eeb-4d81-8d5f-ceda31547645" + ], + ) + self.assertEqual( + store.get_created_resources("statussen"), + [ + "http://localhost:8003/zaken/api/v1/statussen/633da83a-3e82-48e4-8080-efeff2491d2d" + ], + ) + self.assertEqual( + store.get_created_resources("enkelvoudiginformatieobjecten"), + [ + "http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/174fc1c3-36fe-4ed1-b2c4-b0368efa2008" + ], + ) + self.assertEqual( + store.get_created_resources("zaakinformatieobjecten"), + [ + "http://localhost:8003/zaken/api/v1/zaakinformatieobjecten/c7cd732c-8e62-49c2-88ea-e9c888e7a9e7" + ], + )