This commit is contained in:
1 parent
21301ca31b
commit
b65c8c39fe
7 files changed
+45
-12
No files matched your search
@@ -148,6 +148,19 @@ class RecommendTests(RecoFixture):
|
||||
_, results = reco.recommend(self.con, self.mood(), limit=2)
|
||||
self.assertEqual(len(results), 2)
|
||||
|
||||
def test_taste_boost_from_rating(self):
|
||||
self.con.execute("UPDATE personal SET rating = NULL WHERE appid = 4")
|
||||
self.con.commit()
|
||||
_, base = reco.recommend(self.con, self.mood(), limit=10)
|
||||
base_alpha = next(g for g in base if g["appid"] == 1)
|
||||
|
||||
self.con.execute("UPDATE personal SET rating = 9 WHERE appid = 4")
|
||||
self.con.commit()
|
||||
_, boosted = reco.recommend(self.con, self.mood(), limit=10)
|
||||
alpha = next(g for g in boosted if g["appid"] == 1)
|
||||
self.assertGreater(alpha["score"], base_alpha["score"])
|
||||
self.assertIn("Похоже на избранное и высокие оценки", alpha["reasons"])
|
||||
|
||||
def test_feedback_excludes_and_boosts(self):
|
||||
key = "preset:test"
|
||||
_, base = reco.recommend(self.con, self.mood(), limit=10)
|
||||
|
||||
Reference in new issue
Block a user