feat: redesign workspaces and stabilize screeners
This commit is contained in:
@@ -120,10 +120,13 @@ class AccountAccessTests(unittest.TestCase):
|
||||
first = self.database.create_user("note_owner", "salt", "hash")
|
||||
second = self.database.create_user("other_reader", "salt", "hash")
|
||||
note_id = self.database.save_note(
|
||||
first["id"], "002141", "贤丰控股", "20260721", "只属于甲", "明日观察"
|
||||
first["id"], "002141", "贤丰控股", "20260721", "只属于甲", "明日观察",
|
||||
summary="市场缩量修复",
|
||||
)
|
||||
|
||||
self.assertEqual(len(self.database.list_notes(first["id"], code="002141")), 1)
|
||||
first_notes = self.database.list_notes(first["id"], code="002141")
|
||||
self.assertEqual(len(first_notes), 1)
|
||||
self.assertEqual(first_notes[0]["summary"], "市场缩量修复")
|
||||
self.assertEqual(self.database.list_notes(second["id"], code="002141"), [])
|
||||
with self.assertRaises(ValueError):
|
||||
self.database.save_note(
|
||||
@@ -141,10 +144,13 @@ class AccountAccessTests(unittest.TestCase):
|
||||
def test_watchlist_is_scoped_to_its_owner(self):
|
||||
first = self.database.create_user("watch_owner", "salt", "hash")
|
||||
second = self.database.create_user("other_watcher", "salt", "hash")
|
||||
self.database.save_watchlist(first["id"], "002141", "贤丰控股", "元件", "red")
|
||||
self.database.save_watchlist(
|
||||
first["id"], "002141", "贤丰控股", "元件", "red", "观察承接"
|
||||
)
|
||||
self.database.save_watchlist(second["id"], "002141", "贤丰控股", "元件", "blue")
|
||||
|
||||
self.assertEqual(self.database.list_watchlist(first["id"])[0]["color"], "red")
|
||||
self.assertEqual(self.database.list_watchlist(first["id"])[0]["remark"], "观察承接")
|
||||
self.assertEqual(self.database.list_watchlist(second["id"])[0]["color"], "blue")
|
||||
self.assertFalse(self.database.delete_watchlist(second["id"], "000001"))
|
||||
self.assertTrue(self.database.delete_watchlist(first["id"], "002141"))
|
||||
|
||||
Reference in New Issue
Block a user