Skip to content

Commit

Permalink
Merge pull request #594 from maykinmedia/fix/1382-case-title-text
Browse files Browse the repository at this point in the history
[#1382] Update title text in cases
  • Loading branch information
alextreme authored May 2, 2023
2 parents 555b39a + 5ec1bd7 commit 97459a0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 18 deletions.
12 changes: 2 additions & 10 deletions src/open_inwoner/accounts/views/cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,7 @@ def process_cases(self, cases: List[Zaak]) -> List[dict]:
"uuid": str(case.uuid),
"start_date": case.startdatum,
"end_date": getattr(case, "einddatum", None),
"description": (
case.omschrijving
if case.omschrijving
else case.zaaktype.omschrijving
),
"description": case.zaaktype.omschrijving,
"current_status": glom(
case, "status.statustype.omschrijving", default=""
),
Expand Down Expand Up @@ -350,11 +346,7 @@ def get_context_data(self, **kwargs):
"end_date_legal": getattr(
self.case, "uiterlijke_einddatum_afdoening", None
),
"description": (
self.case.omschrijving
if self.case.omschrijving
else self.case.zaaktype.omschrijving
),
"description": self.case.zaaktype.omschrijving,
"current_status": glom(
self.case,
"status.statustype.omschrijving",
Expand Down
2 changes: 1 addition & 1 deletion src/open_inwoner/openzaak/tests/test_case_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def test_status_is_retrieved_when_user_logged_in_via_digid(self, m):
"end_date": datetime.date(2022, 1, 3),
"end_date_planned": datetime.date(2022, 1, 4),
"end_date_legal": datetime.date(2022, 1, 5),
"description": "Zaak naar aanleiding van ingezonden formulier",
"description": "Coffee zaaktype",
"current_status": "Finish",
"statuses": [status_new_obj, status_finish_obj],
# only one visible information object
Expand Down
12 changes: 5 additions & 7 deletions src/open_inwoner/openzaak/tests/test_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,15 +316,15 @@ def test_list_open_cases(self, m):
"start_date": datetime.date.fromisoformat(self.zaak2["startdatum"]),
"end_date": None,
"identificatie": self.zaak2["identificatie"],
"description": self.zaak2["omschrijving"],
"description": self.zaaktype["omschrijving"],
"current_status": self.status_type1["omschrijving"],
},
{
"uuid": self.zaak1["uuid"],
"start_date": datetime.date.fromisoformat(self.zaak1["startdatum"]),
"end_date": None,
"identificatie": self.zaak1["identificatie"],
"description": self.zaak1["omschrijving"],
"description": self.zaaktype["omschrijving"],
"current_status": self.status_type1["omschrijving"],
},
],
Expand Down Expand Up @@ -405,7 +405,7 @@ def test_list_closed_cases(self, m):
"start_date": datetime.date.fromisoformat(self.zaak3["startdatum"]),
"end_date": datetime.date.fromisoformat(self.zaak3["einddatum"]),
"identificatie": self.zaak3["identificatie"],
"description": self.zaak3["omschrijving"],
"description": self.zaaktype["omschrijving"],
"current_status": self.status_type2["omschrijving"],
},
],
Expand Down Expand Up @@ -484,13 +484,12 @@ def test_list_cases_paginated(self, m):
"start_date": datetime.date.fromisoformat(self.zaak2["startdatum"]),
"end_date": None,
"identificatie": self.zaak2["identificatie"],
"description": self.zaak2["omschrijving"],
"description": self.zaaktype["omschrijving"],
"current_status": self.status_type1["omschrijving"],
},
],
)
self.assertNotContains(response_1, self.zaak1["identificatie"])
self.assertNotContains(response_1, self.zaak1["omschrijving"])
self.assertContains(response_1, "?page=2")

# 2. test next page
Expand All @@ -505,13 +504,12 @@ def test_list_cases_paginated(self, m):
"start_date": datetime.date.fromisoformat(self.zaak1["startdatum"]),
"end_date": None,
"identificatie": self.zaak1["identificatie"],
"description": self.zaak1["omschrijving"],
"description": self.zaaktype["omschrijving"],
"current_status": self.status_type1["omschrijving"],
},
],
)
self.assertNotContains(response_2, self.zaak2["identificatie"])
self.assertNotContains(response_2, self.zaak2["omschrijving"])
self.assertContains(response_2, "?page=1")

@patch.object(CaseListMixin, "paginate_by", 1)
Expand Down

0 comments on commit 97459a0

Please sign in to comment.