Skip to content

Commit 0ecf072

Browse files
author
Julian Roeland
committed
👌 - chore: PR changes
1 parent 36972a9 commit 0ecf072

File tree

1 file changed

+6
-40
lines changed

1 file changed

+6
-40
lines changed

backend/src/openarchiefbeheer/zaken/tests/test_utils.py

+6-40
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
from django.test import TestCase
2-
2+
from openarchiefbeheer.destruction.tests.factories import \
3+
DestructionListItemFactory
4+
from openarchiefbeheer.utils.results_store import ResultStore
5+
from openarchiefbeheer.zaken.utils import (delete_zaak_and_related_objects,
6+
format_zaaktype_choices)
37
from requests.exceptions import ConnectTimeout
48
from requests_mock import Mocker
59
from rest_framework import status
610
from zgw_consumers.constants import APITypes
711
from zgw_consumers.test.factories import ServiceFactory
812

9-
from openarchiefbeheer.destruction.tests.factories import DestructionListItemFactory
10-
from openarchiefbeheer.utils.results_store import ResultStore
11-
from openarchiefbeheer.zaken.utils import (
12-
delete_zaak_and_related_objects,
13-
format_zaaktype_choices,
14-
)
15-
1613

1714
class DeletingZakenWithErrorsTests(TestCase):
1815
@classmethod
@@ -151,6 +148,7 @@ def test_failure_on_deleting_zaak_relation_is_handled(self, m):
151148
class FormatZaaktypeChoicesTests(TestCase):
152149
def test_format_zaaktype_choices_with_multiple_versions(self):
153150
# Test that the function picks the latest version of each zaaktype based on versiedatum
151+
# And test that the output is sorted by label
154152
zaaktypen = [
155153
{
156154
"identificatie": "ZKT-001",
@@ -217,35 +215,3 @@ def test_format_zaaktype_choices_with_empty_input(self):
217215
# Should return an empty list
218216
result = format_zaaktype_choices(zaaktypen)
219217
self.assertEqual(result, expected_result)
220-
221-
def test_format_zaaktype_choices_sorted_output(self):
222-
# Test that the output is sorted by label
223-
zaaktypen = [
224-
{
225-
"identificatie": "ZKT-002",
226-
"url": "http://localhost:8000/api/v1/zaaktypen/2",
227-
"omschrijving": "Zaaktype B",
228-
"versiedatum": "2023-01-01",
229-
},
230-
{
231-
"identificatie": "ZKT-001",
232-
"url": "http://localhost:8000/api/v1/zaaktypen/1",
233-
"omschrijving": "Zaaktype A",
234-
"versiedatum": "2023-01-01",
235-
},
236-
]
237-
238-
# Expecting the results to be sorted alphabetically by label
239-
expected_result = [
240-
{
241-
"label": "Zaaktype A (ZKT-001)",
242-
"value": "http://localhost:8000/api/v1/zaaktypen/1",
243-
},
244-
{
245-
"label": "Zaaktype B (ZKT-002)",
246-
"value": "http://localhost:8000/api/v1/zaaktypen/2",
247-
},
248-
]
249-
250-
result = format_zaaktype_choices(zaaktypen)
251-
self.assertEqual(result, expected_result)

0 commit comments

Comments
 (0)