Skip to content

Commit

Permalink
✅ [#1904] Fix tests for Case list duplicate ZaakTypeStatusTypeConfig bug
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbal committed Dec 4, 2023
1 parent 7b36780 commit 2a27bc1
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/open_inwoner/openzaak/tests/test_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
from ..constants import StatusIndicators
from ..models import OpenZaakConfig
from .factories import (
CatalogusConfigFactory,
ServiceFactory,
StatusTranslationFactory,
ZaakTypeConfigFactory,
ZaakTypeStatusTypeConfigFactory,
)
from .mocks import ESuiteData
Expand Down Expand Up @@ -163,6 +165,7 @@ def setUpTestData(cls):
"schemas/ZaakType",
url=f"{CATALOGI_ROOT}zaaktypen/53340e34-7581-4b04-884f",
omschrijving="Coffee zaaktype",
identificatie="ZAAK-2022-0000000001",
catalogus=f"{CATALOGI_ROOT}catalogussen/1b643db-81bb-d71bd5a2317a",
vertrouwelijkheidaanduiding=VertrouwelijkheidsAanduidingen.openbaar,
indicatieInternOfExtern="extern",
Expand Down Expand Up @@ -195,8 +198,16 @@ def setUpTestData(cls):
isEindstatus=True,
)

cls.catalogus_config = CatalogusConfigFactory.create(
url=cls.zaaktype["catalogus"]
)
cls.zaaktype_config1 = ZaakTypeConfigFactory.create(
urls=[cls.zaaktype["url"]],
identificatie=cls.zaaktype["identificatie"],
catalogus=cls.catalogus_config,
)
cls.zt_statustype_config1 = ZaakTypeStatusTypeConfigFactory.create(
zaaktype_config__identificatie="ZAAK-2022-0000000001",
zaaktype_config=cls.zaaktype_config1,
statustype_url=cls.status_type1["url"],
status_indicator=StatusIndicators.warning,
status_indicator_text="U moet documenten toevoegen",
Expand Down Expand Up @@ -376,6 +387,15 @@ def _setUpMocks(self, m):
def test_list_cases(self, m):
self._setUpMocks(m)

self.duplicate_zt_statustype_config = ZaakTypeStatusTypeConfigFactory.create(
statustype_url=self.status_type1["url"],
status_indicator=StatusIndicators.warning,
status_indicator_text="U moet documenten toevoegen",
description="Lorem ipsum dolor sit amet",
call_to_action_url="https://example.com",
call_to_action_text="duplicate",
)

response = self.app.get(
self.inner_url, user=self.user, headers={"HX-Request": "true"}
)
Expand All @@ -390,6 +410,7 @@ def test_list_cases(self, m):
"identification": self.zaak2["identificatie"],
"description": self.zaaktype["omschrijving"],
"current_status": self.status_type1["omschrijving"],
"zaaktype_config": self.zaaktype_config1,
"statustype_config": self.zt_statustype_config1,
"case_type": "Zaak",
},
Expand All @@ -400,6 +421,7 @@ def test_list_cases(self, m):
"identification": self.zaak1["identificatie"],
"description": self.zaaktype["omschrijving"],
"current_status": self.status_type1["omschrijving"],
"zaaktype_config": self.zaaktype_config1,
"statustype_config": self.zt_statustype_config1,
"case_type": "Zaak",
},
Expand All @@ -410,6 +432,7 @@ def test_list_cases(self, m):
"identification": self.zaak3["identificatie"],
"description": self.zaaktype["omschrijving"],
"current_status": self.status_type2["omschrijving"],
"zaaktype_config": self.zaaktype_config1,
"statustype_config": None,
"case_type": "Zaak",
},
Expand Down

0 comments on commit 2a27bc1

Please sign in to comment.