-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✅ [#87] Test retrieving non-existent zaak
- Loading branch information
1 parent
f859306
commit 6a5b653
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -417,3 +417,30 @@ def test_zaakafhandelcomponent_link(self, m): | |
self.assertEqual( | ||
"http://example.nl/987654321/ZAAK-002/uuid-2", zaak_2_data["zac_link"] | ||
) | ||
|
||
def test_retrieve_missing_zaak(self, m): | ||
self._set_up_services() | ||
self._set_up_mocks(m) | ||
|
||
user = UserFactory.create( | ||
username="user", | ||
password="user", | ||
email="[email protected]", | ||
role__can_start_destruction=True, | ||
role__can_review_destruction=True, | ||
) | ||
|
||
destruction_list = DestructionListFactory.create(author=user, assignee=user) | ||
missing_zaak_url = f"{ZAKEN_ROOT}zaken/uuid-3" | ||
DestructionListItemFactory.create( | ||
destruction_list=destruction_list, zaak=missing_zaak_url | ||
) | ||
m.get(missing_zaak_url, status_code=404) | ||
|
||
url = reverse("destruction:fetch-list-items", args=[destruction_list.id]) | ||
|
||
self.client.force_login(user) | ||
response = self.client.get(url) | ||
|
||
self.assertEqual(200, response.status_code) | ||
self.assertIn("error", response.json()) |