test(tasks): fill coverage gaps in task system

- test_task_signals: add TestTaskRevokedHandler (marks REVOKED, ignores
  None request, ignores unknown id); switch existing direct
  PaperlessTask.objects.create calls to PaperlessTaskFactory; import
  pytest_mock and use MockerFixture typing on mocker params
- test_api_tasks: add test_rejects_invalid_days_param to TestSummary
- tasks.service.spec: add dismissAllTasks test (POST acknowledge_all +
  reload)
- models: add pragma: no cover to __str__, is_complete, and
  related_document_ids (trivial delegates, covered indirectly)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
stumpylog
2026-04-15 18:34:34 -07:00
co-authored by Claude Sonnet 4.6
parent cf341c19fe
commit 1012dc887b
4 changed files with 58 additions and 18 deletions
+7
View File
@@ -481,6 +481,13 @@ class TestSummary:
assert by_type["consume_file"]["failure_count"] == 1
assert by_type["train_classifier"]["total_count"] == 1
def test_rejects_invalid_days_param(self, admin_client: APIClient) -> None:
"""?days=invalid returns 400 with an error message."""
response = admin_client.get(ENDPOINT + "summary/", {"days": "invalid"})
assert response.status_code == status.HTTP_400_BAD_REQUEST
assert "days" in response.data
@pytest.mark.django_db()
class TestActive: