Files
chat_backend/llm_be
westfarnandCursor bb4176590c
CI / test (pull_request) Successful in 10s
Unit Tests / test (pull_request) Successful in 9s
Add offline unit test suite for chat_backend (#5)
Replaces the three scattered test modules with a `chat_backend/tests/` package
covering models, DatabaseStorage, serializers, every REST endpoint, the LLM
services, signals and both websocket consumers — 242 deterministic tests that
run without Ollama, Chroma, SMTP or network access, plus 6 opt-in live-Ollama
checks behind RUN_LIVE_OLLAMA_TESTS.

A custom test runner sets SKIP_RAG_INIT and a cheap password hasher so the suite
finishes in seconds and can no longer reach a model server by accident.

Bugs the new tests surfaced, fixed here:
- views.ConversationDetailView.post silently dropped every prompt: `import
  datetime` shadowed `from datetime import datetime`, so `datetime.now()` raised
  inside a bare except.
- get_conversation_file_async in both consumers always returned None with
  DatabaseStorage, because `prompt.file.read` opens the blob (a DB query) during
  attribute access in async context.
- DatabaseStorage._save crashed on str-backed ContentFile.
- prompt_classifier/__init__.,py was never importable as a package init.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 06:48:29 -05:00
..
2025-03-07 12:23:00 -06:00
2025-12-08 13:52:30 -06:00
2025-03-07 12:23:00 -06:00