|
11 | 11 | DestructionListFactory,
|
12 | 12 | DestructionListItemFactory,
|
13 | 13 | DestructionListReviewFactory,
|
| 14 | + ReviewResponseFactory, |
14 | 15 | )
|
15 | 16 |
|
16 | 17 |
|
@@ -267,3 +268,49 @@ def test_reassign_reviewers_noop(self):
|
267 | 268 |
|
268 | 269 | self.assertEqual(destruction_list.status, ListStatus.internally_reviewed)
|
269 | 270 | self.assertEqual(destruction_list.assignee, record_manager)
|
| 271 | + |
| 272 | + def test_archivist_requested_changes(self): |
| 273 | + destruction_list = DestructionListFactory.create( |
| 274 | + status=ListStatus.ready_for_archivist |
| 275 | + ) |
| 276 | + record_manager = DestructionListAssigneeFactory.create( |
| 277 | + role=ListRole.author, |
| 278 | + destruction_list=destruction_list, |
| 279 | + user=destruction_list.author, |
| 280 | + ) |
| 281 | + archivist = DestructionListAssigneeFactory.create( |
| 282 | + role=ListRole.archivist, destruction_list=destruction_list |
| 283 | + ) |
| 284 | + DestructionListReviewFactory.create( |
| 285 | + author=archivist.user, |
| 286 | + destruction_list=destruction_list, |
| 287 | + decision=ReviewDecisionChoices.rejected, |
| 288 | + ) |
| 289 | + |
| 290 | + destruction_list.assign_next() |
| 291 | + |
| 292 | + destruction_list.refresh_from_db() |
| 293 | + |
| 294 | + self.assertEqual(destruction_list.status, ListStatus.changes_requested) |
| 295 | + self.assertEqual(destruction_list.assignee, record_manager.user) |
| 296 | + |
| 297 | + def test_record_manager_processed_changes_after_archivist(self): |
| 298 | + destruction_list = DestructionListFactory.create( |
| 299 | + status=ListStatus.changes_requested |
| 300 | + ) |
| 301 | + archivist = DestructionListAssigneeFactory.create( |
| 302 | + role=ListRole.archivist, destruction_list=destruction_list |
| 303 | + ) |
| 304 | + review = DestructionListReviewFactory.create( |
| 305 | + author=archivist.user, |
| 306 | + destruction_list=destruction_list, |
| 307 | + decision=ReviewDecisionChoices.rejected, |
| 308 | + ) |
| 309 | + ReviewResponseFactory.create(review=review) |
| 310 | + |
| 311 | + destruction_list.assign_next() |
| 312 | + |
| 313 | + destruction_list.refresh_from_db() |
| 314 | + |
| 315 | + self.assertEqual(destruction_list.status, ListStatus.ready_for_archivist) |
| 316 | + self.assertEqual(destruction_list.assignee, archivist.user) |
0 commit comments