Skip to content

Commit 4b94fa8

Browse files
SilviaAmAmsvenvandescheur
authored andcommitted
🧪 [#303] Test empty identificatie zaaktype
1 parent 2863590 commit 4b94fa8

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

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

+34
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from unittest.mock import patch
22

33
from django.core.cache import cache
4+
from django.utils.translation import gettext_lazy as _
45

56
from furl import furl
67
from requests_mock import Mocker
@@ -143,6 +144,39 @@ def test_retrieve_zaaktypen_choices(self, m):
143144
],
144145
)
145146

147+
@Mocker()
148+
def test_retrieve_zaaktypen_choices_empty_identificatie(self, m):
149+
ServiceFactory.create(
150+
api_type=APITypes.ztc,
151+
api_root="http://catalogi-api.nl/catalogi/api/v1",
152+
)
153+
user = UserFactory.create(role__can_start_destruction=True)
154+
ZaakFactory.create(
155+
zaaktype="http://catalogi-api.nl/catalogi/api/v1/zaakypen/111-111-111",
156+
_expand={"zaaktype": {"identificatie": ""}},
157+
)
158+
159+
m.get(
160+
"http://catalogi-api.nl/catalogi/api/v1/zaaktypen",
161+
json={
162+
"count": 1,
163+
"results": [
164+
{
165+
"url": "http://catalogi-api.nl/catalogi/api/v1/zaakypen/111-111-111",
166+
"identificatie": "",
167+
},
168+
],
169+
},
170+
)
171+
172+
self.client.force_authenticate(user=user)
173+
endpoint = reverse("api:retrieve-zaaktypen-choices")
174+
175+
response = self.client.get(endpoint)
176+
177+
self.assertEqual(response.status_code, status.HTTP_200_OK)
178+
self.assertEqual(response.json()[0]["label"], _("(no identificatie)"))
179+
146180
@Mocker()
147181
def test_response_cached(self, m):
148182
ServiceFactory.create(

0 commit comments

Comments
 (0)