Backend upload-automation file
This commit is contained in:
@@ -109,6 +109,25 @@ def _reset_login_throttle():
|
||||
auth_router._failures.clear()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def review_inbox_mode(monkeypatch):
|
||||
"""Pin POST /api/uploads/catalog to the review-inbox path.
|
||||
|
||||
`UPLOAD_AUTORUN` ships true, so an upload now runs the pipeline on arrival.
|
||||
The inbox is still a supported mode - it is exactly what setting the flag
|
||||
false turns back on - and the modules covering it declare this fixture
|
||||
autouse, so their subject is stated rather than inherited from whatever the
|
||||
default happens to be on the day.
|
||||
|
||||
Patched on the ROUTER module, not on settings: the handler reads the name
|
||||
out of its own globals at call time, which is the idiom batch_common's
|
||||
docstring describes for the BATCH_* limits.
|
||||
"""
|
||||
from app.api.routers import uploads
|
||||
|
||||
monkeypatch.setattr(uploads, "UPLOAD_AUTORUN", False)
|
||||
|
||||
|
||||
def _token(client: TestClient, username: str, password: str) -> str:
|
||||
resp = client.post("/api/auth/login", json={"username": username, "password": password})
|
||||
assert resp.status_code == 200, resp.text
|
||||
|
||||
Reference in New Issue
Block a user