diff --git a/backend/src/openarchiefbeheer/destruction/tests/test_endpoints.py b/backend/src/openarchiefbeheer/destruction/tests/test_endpoints.py index 2d4c4985..fa9429ab 100644 --- a/backend/src/openarchiefbeheer/destruction/tests/test_endpoints.py +++ b/backend/src/openarchiefbeheer/destruction/tests/test_endpoints.py @@ -681,8 +681,16 @@ def test_cannot_mark_as_final_if_posted_user_is_not_archivist(self): ) def test_mark_as_ready_to_review(self): - record_manager = UserFactory.create(post__can_start_destruction=True) - + record_manager = UserFactory.create( + username="dolly123", + first_name="Dolly", + last_name="Sheep", + post__can_start_destruction=True, + ) + record_manager_group, created = Group.objects.get_or_create( + name="Record Manager" + ) + record_manager.groups.add(record_manager_group) destruction_list = DestructionListFactory.create( name="A test list", author=record_manager, @@ -726,6 +734,22 @@ def test_mark_as_ready_to_review(self): self.assertEqual(sent_mail[0].subject, "Destruction list review request") self.assertEqual(sent_mail[0].recipients(), [reviewer.user.email]) + logs = TimelineLog.objects.for_object(destruction_list) + + self.assertEqual(logs.count(), 1) + self.assertEqual( + logs[0].get_message(), + _( + "User %(record_manager)s (member of group %(groups)s) has marked the " + 'destruction list "%(list_name)s" as ready to review.' + ) + % { + "record_manager": "Dolly Sheep (dolly123)", + "groups": "Record Manager", + "list_name": "A test list", + }, + ) + def test_cannot_mark_as_ready_to_review_if_not_authenticated(self): destruction_list = DestructionListFactory.create( name="A test list", diff --git a/backend/src/openarchiefbeheer/logging/tests/test_logevent.py b/backend/src/openarchiefbeheer/logging/tests/test_logevent.py index 772b671f..3d0f7915 100644 --- a/backend/src/openarchiefbeheer/logging/tests/test_logevent.py +++ b/backend/src/openarchiefbeheer/logging/tests/test_logevent.py @@ -30,8 +30,13 @@ def test_destruction_list_ready_for_first_review(self): }, "resultaat": { "url": "http://zaken-api.nl/zaken/api/v1/resultaten/111-111-111", - "uuid": "111-111-111", "toelichting": "Completed.", + "_expand": { + "resultaattype": { + "url": "http://catalogue-api.nl/catalogi/api/v1/resultaattypen/111-111-111", + "omschrijving": "Completed.", + } + }, }, } items[1].zaak._expand = { @@ -43,8 +48,13 @@ def test_destruction_list_ready_for_first_review(self): }, "resultaat": { "url": "http://zaken-api.nl/zaken/api/v1/resultaten/111-111-111", - "uuid": "111-111-111", "toelichting": "Completed.", + "_expand": { + "resultaattype": { + "url": "http://catalogue-api.nl/catalogi/api/v1/resultaattypen/111-111-111", + "omschrijving": "Completed.", + } + }, }, } items[2].zaak._expand = { @@ -56,8 +66,13 @@ def test_destruction_list_ready_for_first_review(self): }, "resultaat": { "url": "http://zaken-api.nl/zaken/api/v1/resultaten/222-222-222", - "uuid": "222-222-222", "toelichting": "Abandoned.", + "_expand": { + "resultaattype": { + "url": "http://catalogue-api.nl/catalogi/api/v1/resultaattypen/222-222-222", + "omschrijving": "Abandoned.", + } + }, }, } @@ -99,11 +114,13 @@ def test_destruction_list_ready_for_first_review(self): [ { "label": "Abandoned.", - "value": "http://zaken-api.nl/zaken/api/v1/resultaten/222-222-222", + "value": "http://catalogue-api.nl/catalogi/api/v1/resultaattypen/222-222-222", + "extra_data": {"toelichting": "Abandoned."}, }, { "label": "Completed.", - "value": "http://zaken-api.nl/zaken/api/v1/resultaten/111-111-111", + "value": "http://catalogue-api.nl/catalogi/api/v1/resultaattypen/111-111-111", + "extra_data": {"toelichting": "Completed."}, }, ], ) diff --git a/backend/src/openarchiefbeheer/zaken/tests/factories.py b/backend/src/openarchiefbeheer/zaken/tests/factories.py index 50145463..c4607f6b 100644 --- a/backend/src/openarchiefbeheer/zaken/tests/factories.py +++ b/backend/src/openarchiefbeheer/zaken/tests/factories.py @@ -55,6 +55,7 @@ def post(obj, create, extracted, **kwargs): "resultaattype": { "url": "http://catalogue-api.nl/catalogi/api/v1/resultaattypen/111-111-111", "archiefactietermijn": "P1D", + "omschrijving": "This is a result type", } }, },