mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-07-18 09:54:55 +00:00
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:
co-authored by
Claude Sonnet 4.6
parent
cf341c19fe
commit
1012dc887b
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user