|
3 | 3 |
|
4 | 4 | from zgw_consumers.api_models.base import factory
|
5 | 5 |
|
6 |
| -from open_inwoner.openzaak.api_models import Zaak |
| 6 | +from open_inwoner.openzaak.api_models import Zaak, ZaakType |
| 7 | +from open_inwoner.openzaak.models import OpenZaakConfig |
7 | 8 |
|
8 | 9 |
|
9 | 10 | class ZaakAPIModelTest(TestCase):
|
@@ -90,3 +91,36 @@ def test_status_text_default(self):
|
90 | 91 | case = factory(Zaak, data=self.zaak_data)
|
91 | 92 |
|
92 | 93 | self.assertEqual(case.status_text, _("No data available"))
|
| 94 | + |
| 95 | + def test_zaak_omschrijving(self): |
| 96 | + zaaktype = factory( |
| 97 | + ZaakType, |
| 98 | + data={ |
| 99 | + "url": "https://example.com", |
| 100 | + "identificatie": "VTH001", |
| 101 | + "catalogus": "https://example.com", |
| 102 | + "vertrouwelijkheidaanduiding": "openbaar", |
| 103 | + "doel": "-", |
| 104 | + "aanleiding": "-", |
| 105 | + "indicatie_intern_of_extern": "extern", |
| 106 | + "handeling_initiator": "Aanvragen", |
| 107 | + "onderwerp": "VTH", |
| 108 | + "handeling_behandelaar": "Behandelen", |
| 109 | + "statustypen": [], |
| 110 | + "resultaattypen": [], |
| 111 | + "informatieobjecttypen": [], |
| 112 | + "omschrijving": "Vergunning", |
| 113 | + }, |
| 114 | + ) |
| 115 | + self.zaak_data["zaaktype"] = zaaktype |
| 116 | + self.zaak_data["omschrijving"] = "Vergunning voor Joeri" |
| 117 | + |
| 118 | + case = factory(Zaak, data=self.zaak_data) |
| 119 | + |
| 120 | + self.assertEqual(case.description, "Vergunning") |
| 121 | + |
| 122 | + zaak_config = OpenZaakConfig.get_solo() |
| 123 | + zaak_config.use_zaak_omschrijving_as_title = True |
| 124 | + zaak_config.save() |
| 125 | + |
| 126 | + self.assertEqual(case.description, "Vergunning voor Joeri") |
0 commit comments