Skip to content

DeepTutor: Lifelong Personalized Tutoring. https://deeptutor.info/.

fix: update tests for extra=ignore and RAG tuple return type

unknowna6cef24c2f6c
diff --git a/deeptutor/learning/tests/test_llm_integration.py b/deeptutor/learning/tests/test_llm_integration.py
index 9bbcb514a..323ad6311 100644
--- a/deeptutor/learning/tests/test_llm_integration.py
+++ b/deeptutor/learning/tests/test_llm_integration.py
@@ -64,7 +64,7 @@ class TestRAGIntegration:
"""_call_llm should call _retrieve_context and inject results."""
cap = GuidedLearningCapability(kb_name="test_kb")
with patch.object(cap, "_retrieve_context", new_callable=AsyncMock,
- return_value="\n\n参考教材内容:\nSome content") as mock_rag:
+ return_value=("\n\n参考教材内容:\nSome content", "")) as mock_rag:
with patch("deeptutor.capabilities.guided_learning.complete",
new_callable=AsyncMock) as mock_complete:
mock_complete.return_value = "response"
diff --git a/deeptutor/learning/tests/test_models.py b/deeptutor/learning/tests/test_models.py
index 66f9bbf28..c2622e6be 100644
--- a/deeptutor/learning/tests/test_models.py
+++ b/deeptutor/learning/tests/test_models.py
@@ -151,9 +151,10 @@ class TestLearningProgress:
assert lp.modules == []
assert isinstance(lp.created_at, float)
- def test_extra_allowed(self):
+ def test_extra_ignored(self):
lp = LearningProgress(book_id="b1", custom_field="hello")
- assert lp.model_extra.get("custom_field") == "hello"
+ assert not hasattr(lp, "custom_field")
+ assert lp.book_id == "b1"
# ── Serialization roundtrip ─────────────────────────────────────────────