feat: personalize and stream mentor chat
This commit is contained in:
@@ -78,6 +78,21 @@ class AccountDataBoundaryTests(unittest.TestCase):
|
||||
self.database.delete_mentor_messages(self.first["id"], "mentor-a", "20260721"), 2
|
||||
)
|
||||
|
||||
def test_mentor_preferences_are_scoped_by_user(self):
|
||||
self.database.save_mentor_preferences(
|
||||
self.first["id"], ["mentor-b", "mentor-a"], {"mentor-b"}
|
||||
)
|
||||
self.database.save_mentor_preferences(
|
||||
self.second["id"], ["mentor-a", "mentor-b"], set()
|
||||
)
|
||||
|
||||
first = self.database.list_mentor_preferences(self.first["id"])
|
||||
second = self.database.list_mentor_preferences(self.second["id"])
|
||||
self.assertEqual([item["mentor_id"] for item in first], ["mentor-b", "mentor-a"])
|
||||
self.assertTrue(first[0]["pinned"])
|
||||
self.assertEqual([item["mentor_id"] for item in second], ["mentor-a", "mentor-b"])
|
||||
self.assertFalse(any(item["pinned"] for item in second))
|
||||
|
||||
def test_latest_data_snapshot_skips_demo_and_future_records(self):
|
||||
self.database.save_data_snapshot(
|
||||
"stock_detail", "002141:20260718", "tushare", {"marker": "real"}
|
||||
|
||||
Reference in New Issue
Block a user