Delegiert System handbook

Chapter 10 / 14

Testing

Test layers

Pure unit tests cover rules, schemas, authorization, adapters, and generators. Sanic HTTP contract tests exercise routes through native request lifecycles. PostgreSQL and Redis conformance tests cover transaction, lock, expiry, idempotency, and queue behavior. Browser tests exercise generated PWA, slides, handbook, mobile, keyboard, print, and reduced-motion behavior.

Release gates

Running tests

Use the API virtual environment: API/.venv/bin/python -m pytest. Run focused tests during red/green development, then the full affected suite. Tests requiring loopback sockets or Chromium must run in an environment that permits them; a sandbox permission error is not an application assertion.

Generated output is checked twice: the builder must reproduce checked-in bytes, and deployment asset hashes must match those bytes.

Owner: Engineering Reviewed: 2026-09-01 Revision: domain-schema-v2-2026-09-01