fix: round goal sessions up
This commit is contained in:
1 parent
d3e3a4802c
commit
8e7fa97f27
3 files changed
+13
-2
No files matched your search
@@ -44,6 +44,16 @@ class ApiTests(unittest.TestCase):
|
||||
self.assertEqual(response["result"]["total_hours"], 2)
|
||||
self.assertIn("Осталось добрать: 24", response["message"])
|
||||
|
||||
def test_calculate_and_store_uses_calculation_store(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": "goal", "current_points": 0, "target_points": 25,
|
||||
"minutes_per_session": 20, "skill": "ЛУ", "kitten_count": 1,
|
||||
}, actor_id=None, source="web")
|
||||
self.assertEqual(response["result"]["sessions"], 7)
|
||||
|
||||
def test_calculate_inspection_payload(self):
|
||||
response = calculate_payload(
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user