fix: return earned points calculations without saving

This commit is contained in:
nyan404 committed 2026-08-25 13:48:25 +03:00
1 parent c838cb8410
commit aa49634d93
3 files changed
+22

No files matched your search

+10
View File
@@ -75,6 +75,16 @@ class ApiTests(unittest.TestCase):
}, actor_id=None, source="web")
self.assertEqual(response["result"]["sessions"], 7)
def test_points_calculation_is_not_saved_as_a_report(self):
with TemporaryDirectory() as directory:
with patch.dict("os.environ", {"BELKI_DATABASE_URL": "", "BELKI_HISTORY_DB": f"{directory}/history.sqlite3"}, clear=False):
api._CALCULATION_STORE = None
response = api.calculate_and_store({
"mode": "points", "activity": "coaching", "skill": "ЛУ", "start": "11:00", "end": "11:20",
"kitten_statuses": ["самостоятельно"],
}, actor_id=None, source="web")
self.assertEqual(response["result"]["curator_points"], 4)
def test_calculate_inspection_payload(self):
response = calculate_payload(
{