Files
NexaPantry/backend/app/tests/test_security.py
nessi 3792ca55e7
Some checks failed
CI / backend (push) Failing after 31s
CI / frontend (push) Successful in 40s
CI / docker (push) Has been skipped
chore: initial project setup with backend, frontend, and infrastructure
Add complete NexaPantry application structure including:
- Docker Compose configuration with PostgreSQL, Redis, FastAPI backend, worker, frontend and Caddy
- Environment configuration template with database, auth, and service settings
- GitHub Actions CI workflow for backend/frontend linting, testing, auditing and Docker builds
- AGPL-3.0 license and comprehensive README with setup, development, and security documentation
- Backend
2026-06-04 10:26:38 +02:00

15 lines
499 B
Python

from app.core.security import hash_password, hash_token, verify_password
def test_password_hash_roundtrip() -> None:
password_hash = hash_password("a-very-long-password")
assert password_hash != "a-very-long-password"
assert verify_password("a-very-long-password", password_hash)
assert not verify_password("wrong-password", password_hash)
def test_tokens_are_hashed() -> None:
assert hash_token("secret") == hash_token("secret")
assert hash_token("secret") != "secret"