diff --git a/app/bot.py b/app/bot.py index 7d9f791..499d276 100644 --- a/app/bot.py +++ b/app/bot.py @@ -144,7 +144,7 @@ async def add_task(update: Update, context: CallbackContext): name=str(task_id), ) - await update.message.reply_text("Task added successfully!") + await update.message.reply_text(f"Task {task_id} added successfully!") except sqlite3.Error as e: logging.error(f"Database error: {e}") await update.message.reply_text( diff --git a/tests/test_add_task.py b/tests/test_add_task.py index beb6e9a..10bf8c1 100644 --- a/tests/test_add_task.py +++ b/tests/test_add_task.py @@ -44,12 +44,13 @@ async def test_add_task_valid_input(): with patch("sqlite3.connect") as mock_connect: mock_cursor = MagicMock() mock_connect.return_value.cursor.return_value = mock_cursor + task_id = mock_cursor.lastrowid await add_task(update, context) mock_cursor.execute.assert_called() update.message.reply_text.assert_called_with( - "Task added successfully!" + f"Task {task_id} added successfully!" )