|
1 | 1 | from datetime import date
|
2 | 2 |
|
3 |
| -from django.test import TestCase |
| 3 | +from django.test import TestCase, tag |
4 | 4 |
|
5 | 5 | from timeline_logger.models import TimelineLog
|
6 | 6 |
|
@@ -129,3 +129,33 @@ def test_destruction_list_ready_for_first_review(self):
|
129 | 129 | )
|
130 | 130 | self.assertEqual(extra_data["comment"], "A list to test logging data.")
|
131 | 131 | self.assertEqual(extra_data["number_of_zaken"], 3)
|
| 132 | + |
| 133 | + @tag("gh-539") |
| 134 | + def test_resultaat_of_zaak_can_be_not_set(self): |
| 135 | + user = UserFactory.create(post__can_start_destruction=True) |
| 136 | + destruction_list = DestructionListFactory.create( |
| 137 | + comment="A list to test logging data.", author=user |
| 138 | + ) |
| 139 | + item = DestructionListItemFactory.create( |
| 140 | + destruction_list=destruction_list, |
| 141 | + with_zaak=True, |
| 142 | + ) |
| 143 | + item.zaak._expand = { |
| 144 | + "zaaktype": { |
| 145 | + "url": "http://catalogi-api.nl/catalogi/api/v1/zaakypen/111-111-111", |
| 146 | + "identificatie": "ZAAKTYPE-01", |
| 147 | + "omschrijving": "ZAAKTYPE 1.0", |
| 148 | + "versiedatum": "2024-01-01", |
| 149 | + }, |
| 150 | + # No resultaat present |
| 151 | + } |
| 152 | + item.zaak.save() |
| 153 | + |
| 154 | + logevent.destruction_list_ready_for_first_review(destruction_list, user) |
| 155 | + |
| 156 | + log = TimelineLog.objects.for_object(destruction_list)[0] |
| 157 | + |
| 158 | + self.assertEqual( |
| 159 | + log.extra_data["resultaten"], |
| 160 | + [], |
| 161 | + ) |
0 commit comments