24
24
from open_inwoner .accounts .tests .factories import UserFactory
25
25
from open_inwoner .cms .cases .views .status import SimpleFile
26
26
from open_inwoner .openzaak .tests .factories import (
27
+ StatusTranslationFactory ,
27
28
ZaakTypeConfigFactory ,
28
29
ZaakTypeInformatieObjectTypeConfigFactory ,
29
30
)
@@ -350,6 +351,8 @@ def _setUpMocks(self, m):
350
351
)
351
352
352
353
def test_status_is_retrieved_when_user_logged_in_via_digid (self , m ):
354
+ self .maxDiff = None
355
+
353
356
self ._setUpMocks (m )
354
357
status_new_obj , status_finish_obj = factory (
355
358
Status , [self .status_new , self .status_finish ]
@@ -370,7 +373,16 @@ def test_status_is_retrieved_when_user_logged_in_via_digid(self, m):
370
373
"end_date_legal" : datetime .date (2022 , 1 , 5 ),
371
374
"description" : "Coffee zaaktype" ,
372
375
"current_status" : "Finish" ,
373
- "statuses" : [status_new_obj , status_finish_obj ],
376
+ "statuses" : [
377
+ {
378
+ "date" : datetime .datetime (2021 , 1 , 12 ),
379
+ "label" : "Initial request" ,
380
+ },
381
+ {
382
+ "date" : datetime .datetime (2021 , 3 , 12 ),
383
+ "label" : "Finish" ,
384
+ },
385
+ ],
374
386
# only one visible information object
375
387
"documents" : [self .informatie_object_file ],
376
388
"initiator" : "Foo Bar van der Bazz" ,
@@ -407,6 +419,24 @@ def test_page_reformats_zaak_identificatie(self, m):
407
419
408
420
spy_format .assert_called_once ()
409
421
422
+ def test_page_translates_statuses (self , m ):
423
+ st1 = StatusTranslationFactory (
424
+ status = self .status_type_new ["omschrijving" ],
425
+ translation = "Translated First Status Type" ,
426
+ )
427
+ st2 = StatusTranslationFactory (
428
+ status = self .status_type_finish ["omschrijving" ],
429
+ translation = "Translated Second Status Type" ,
430
+ )
431
+ self ._setUpMocks (m )
432
+ response = self .app .get (
433
+ self .case_detail_url , user = self .user , headers = {"HX-Request" : "true" }
434
+ )
435
+ self .assertNotContains (response , st1 .status )
436
+ self .assertNotContains (response , st2 .status )
437
+ self .assertContains (response , st1 .translation )
438
+ self .assertContains (response , st2 .translation )
439
+
410
440
def test_when_accessing_case_detail_a_timelinelog_is_created (self , m ):
411
441
self ._setUpMocks (m )
412
442
0 commit comments