Revert "fix(posts): split copy_text and callback_data into separate buttons per Bot API spec"

This reverts commit b96bffda37.
This commit is contained in:
admin committed 2026-10-30 14:52:27 +02:00
1 parent b96bffda37
commit 3a6cc1067f
3 files changed
+6 -18

No files matched your search

+3 -5
View File
@@ -1232,10 +1232,9 @@ class PostCopyButtonTests(unittest.IsolatedAsyncioTestCase):
):
await bot._send_three_posts(cast(Any, message), ["Пост А", "Пост Б"], user_id=None)
first = message.answer.await_args_list[0]
copy_button, stats_button = first.kwargs["reply_markup"].inline_keyboard[0]
self.assertEqual(copy_button.copy_text.text, "Пост А")
self.assertIsNone(copy_button.callback_data) # по доке: copy_text и callback_data в одной кнопке несовместимы
self.assertEqual(stats_button.callback_data, "copy_post:0")
button = first.kwargs["reply_markup"].inline_keyboard[0][0]
self.assertEqual(button.copy_text.text, "Пост А")
self.assertEqual(button.callback_data, "copy_post:0")
async def test_copy_callback_records_event_and_keeps_button(self):
callback = SimpleNamespace(
@@ -1243,7 +1242,6 @@ class PostCopyButtonTests(unittest.IsolatedAsyncioTestCase):
message=MagicMock(spec=bot.Message),
answer=AsyncMock(),
)
callback.message.edit_reply_markup = AsyncMock()
with patch.object(bot.asyncio, "to_thread", new=AsyncMock()) as to_thread:
await bot.post_copy_pressed(cast(Any, callback))
to_thread.assert_awaited_once()