mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-11-02 18:56:06 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fefe4e5802 | ||
|
|
936f9363a0 |
No files matched your search
@@ -690,6 +690,9 @@ logging.config.dictConfig(LOGGING)
|
||||
|
||||
# https://docs.celeryq.dev/en/stable/userguide/configuration.html
|
||||
|
||||
# Tasks outside tasks.py must be loaded even when Django skips checks
|
||||
CELERY_IMPORTS = ("documents.bulk_edit",)
|
||||
|
||||
CELERY_BROKER_URL = _CELERY_REDIS_URL
|
||||
CELERY_RESULT_BACKEND = _CELERY_REDIS_URL
|
||||
CELERY_RESULT_SERIALIZER = "signed-pickle"
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import hmac
|
||||
import os
|
||||
import pickle
|
||||
import subprocess
|
||||
import sys
|
||||
from hashlib import sha256
|
||||
from pathlib import Path
|
||||
|
||||
@@ -11,6 +14,42 @@ from paperless.celery import signed_pickle_loads
|
||||
from paperless.signed_pickle import HMAC_SIZE
|
||||
|
||||
|
||||
def test_tasks_registered_without_system_checks() -> None:
|
||||
# Use a fresh interpreter: Django checks and other tests can import views,
|
||||
# hiding tasks that the worker would otherwise never register.
|
||||
result = subprocess.run(
|
||||
[
|
||||
sys.executable,
|
||||
"-c",
|
||||
"""
|
||||
import sys
|
||||
|
||||
from paperless.celery import app
|
||||
|
||||
app.loader.import_default_modules()
|
||||
expected = {
|
||||
"documents.bulk_edit.delete",
|
||||
"documents.bulk_edit.restore_archive_serial_numbers_task",
|
||||
"documents.signals.handlers.process_cf_select_update",
|
||||
"documents.workflows.webhooks.send_webhook",
|
||||
"paperless_mail.mail.apply_mail_action",
|
||||
"paperless_mail.mail.error_callback",
|
||||
}
|
||||
missing = expected - set(app.tasks)
|
||||
assert not missing, f"Unregistered tasks: {sorted(missing)}"
|
||||
assert "paperless.urls" not in sys.modules
|
||||
""",
|
||||
],
|
||||
env={**os.environ, "CELERY_SKIP_CHECKS": "1"},
|
||||
cwd=Path(__file__).resolve().parents[2],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
timeout=60,
|
||||
check=False,
|
||||
)
|
||||
assert result.returncode == 0, result.stdout + result.stderr
|
||||
|
||||
|
||||
class TestSignedPickleSerializer:
|
||||
def test_roundtrip_simple_types(self) -> None:
|
||||
"""Signed pickle can round-trip basic JSON-like types."""
|
||||
|
||||
@@ -1332,11 +1332,11 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "filelock"
|
||||
version = "4.2.4"
|
||||
version = "4.2.6"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/d8/28/3893324bcadf8f89b1616637468d766af3f625008c0735bf704fdfa86617/filelock-4.2.4.tar.gz", hash = "sha256:c6d8663535e1650ee430507b4ffbac7b464dd64b7647ea0112a9f406499d163d", size = 652444, upload-time = "2026-10-19T01:57:51.001Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/35/6c/730b340182f1fd74d4ef8d3f35431ce84f8f97b1a1f2afd145174b7bb047/filelock-4.2.6.tar.gz", hash = "sha256:ee7af8ede36dcaf12e1016d9f7c3a63ecd5497d46f85dab21b8c779b8f944e97", size = 661339, upload-time = "2026-10-31T15:10:16.889Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/e0/1b/5e74289a1878e666bb4b65fe5805a04cafcac2aa5f519ef1ead67ef91c56/filelock-4.2.4-py3-none-any.whl", hash = "sha256:301241438c57936ef93f4243a94f2559022268bfcf9b375a9a72eb0f8db8358e", size = 162475, upload-time = "2026-10-19T01:57:49.419Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b7/8d/3f849fcb79359259737bc2d8ddcaee6149ffb773239a260c9ff20179736f/filelock-4.2.6-py3-none-any.whl", hash = "sha256:fd7d4fca497bf3e3d0945a13261f8e684f2aef12ce7cf76aef26e13bf7388b88", size = 164378, upload-time = "2026-10-31T15:10:15.322Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
Reference in new issue
Block a user