Suite: test PIN, cornice e worker PDF allineati all'integrazione (#65)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@ from fastapi import HTTPException
|
||||
from httpx import AsyncClient
|
||||
from sqlalchemy import select
|
||||
|
||||
from src.backend.config import settings
|
||||
from src.backend.models.orm.user import User
|
||||
from src.backend.services import auth_service
|
||||
from src.backend.tests.conftest import _create_user, auth_headers
|
||||
@@ -15,6 +16,13 @@ from src.backend.tests.test_production_runs import (
|
||||
from src.backend.utils.tempo import utcnow
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _alza_limite_login(monkeypatch):
|
||||
# #65: login-pin conta nel bucket del login (limite al minuto); i test del blocco PIN
|
||||
# fanno piu tentativi di fila, quindi qui il limite si alza. Il middleware resta com'e.
|
||||
monkeypatch.setattr(settings, "rate_limit_login", 1000)
|
||||
|
||||
|
||||
async def _pin_user(db_session, username="operaio", pin="1234", **kw) -> User:
|
||||
user = await _create_user(db_session, username=username, **kw)
|
||||
await auth_service.set_user_pin(db_session, user, pin)
|
||||
|
||||
@@ -25,7 +25,8 @@
|
||||
{% include "admin/_users_panel.html" %}
|
||||
</div>
|
||||
|
||||
<div x-show="tab === 'generale'" class="max-w-4xl mx-auto" x-data="systemSettings()">
|
||||
{# #65: niente larghezza propria, la scheda sta nella cornice .tmf-page #}
|
||||
<div x-show="tab === 'generale'" x-data="systemSettings()">
|
||||
<!-- Settings Card -->
|
||||
<div class="tmf-card mb-6">
|
||||
<div class="tmf-card-header flex items-center gap-2">
|
||||
|
||||
@@ -32,6 +32,10 @@ def _views():
|
||||
rel = path.relative_to(TEMPLATES).as_posix()
|
||||
if rel.startswith("components/") or rel == "base.html":
|
||||
continue
|
||||
# #65: i parziali (nome che comincia per "_") sono inclusi da un'altra vista
|
||||
# e stanno dentro la sua cornice .tmf-page: da soli non ne hanno una.
|
||||
if path.name.startswith("_"):
|
||||
continue
|
||||
yield rel, path
|
||||
|
||||
|
||||
|
||||
@@ -128,9 +128,11 @@ def test_the_pdf_worker_is_local_everywhere_it_is_set():
|
||||
assert "vendor/pdf.worker" in line, (
|
||||
f"{path.relative_to(APP_ROOT)}:{n} punta il worker fuori casa"
|
||||
)
|
||||
# Four templates render PDFs; if that number changes the new one needs the
|
||||
# Five templates render PDFs; if that number changes the new one needs the
|
||||
# worker set too, and this is where you find out.
|
||||
assert len(setters) == 4, f"template che impostano il worker: {setters}"
|
||||
# #65: da quattro a cinque, task_execute.html mostra PDF nelle note e negli
|
||||
# allegati dell'esecuzione (#55).
|
||||
assert len(setters) == 5,f"template che impostano il worker: {setters}"
|
||||
|
||||
|
||||
def test_the_shipped_libraries_are_the_ones_that_were_checked():
|
||||
|
||||
Reference in New Issue
Block a user