Commit d68f9fd 1 parent c3871b3 commit d68f9fd Copy full SHA for d68f9fd
File tree 1 file changed +25
-0
lines changed
backend/src/openarchiefbeheer/zaken/tests
1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1
1
from unittest .mock import patch
2
2
3
3
from django .core .cache import cache
4
+ from django .test import tag
4
5
from django .utils .translation import gettext_lazy as _
5
6
6
7
from furl import furl
@@ -265,6 +266,30 @@ def test_retrieve_zaaktypen_choices_for_destruction_list(self):
265
266
266
267
self .assertEqual (choices [1 ]["value" ], items_in_list [2 ].zaak .zaaktype )
267
268
269
+ @tag ("gh-303" )
270
+ def test_retrieve_zaaktypen_choices_for_destruction_list_if_zaaktype_id_empty (self ):
271
+ user = UserFactory .create (role__can_start_destruction = True )
272
+
273
+ item = DestructionListItemFactory .create (
274
+ with_zaak = True ,
275
+ zaak__with_expand = True ,
276
+ status = ListItemStatus .suggested ,
277
+ )
278
+ item .zaak ._expand ["zaaktype" ]["identificatie" ] = ""
279
+ item .zaak .save ()
280
+
281
+ self .client .force_authenticate (user = user )
282
+ endpoint = furl (reverse ("api:retrieve-zaaktypen-choices" ))
283
+ endpoint .args ["destruction_list" ] = item .destruction_list .uuid
284
+
285
+ response = self .client .get (endpoint .url )
286
+
287
+ self .assertEqual (response .status_code , status .HTTP_200_OK )
288
+
289
+ choices = response .json ()
290
+
291
+ self .assertEqual (choices [0 ]["label" ], _ ("(no identificatie)" ))
292
+
268
293
@Mocker ()
269
294
def test_not_cached_if_query_param_chages (self , m ):
270
295
user = UserFactory .create (role__can_start_destruction = True )
You can’t perform that action at this time.
0 commit comments