Admin fixes

This commit is contained in:
nyan404 committed 2026-08-16 21:03:25 +03:00
1 parent 6db39f0d51
commit a7f6fc0fc8
18 files changed
+285 -59

No files matched your search

+12 -2
View File
@@ -123,9 +123,9 @@ class VkConversationTests(unittest.TestCase):
dialog.handle(106, "дупло")
dialog.handle(106, "6")
dialog.handle(106, "Серолап [1617140]")
self.assertIn("скриншот", dialog.handle(106, "-1 вьюнок, + 3 паук").lower())
self.assertIn("скриншот", dialog.handle(106, "+1 вьюнок, + 3 паук").lower())
confirmation = self.add_screenshot(dialog, 106)
self.assertIn("вьюнок=-1", confirmation)
self.assertIn("вьюнок=1", confirmation)
self.assertIn("паук=3", confirmation)
def test_queued_photo_is_saved_in_confirmed_state(self):
@@ -138,6 +138,16 @@ class VkConversationTests(unittest.TestCase):
self.assertIn("подтверд", confirmation.lower())
self.assertEqual(dialog._states[107]["attachments"][0]["url"], "https://example.test/photo.jpg")
def test_six_photos_are_kept_on_active_report(self):
dialog = BelkiDialog()
dialog.handle(109, "/урок")
dialog.handle(109, "Белка [1]")
dialog.handle(109, "Котёнок [2]")
dialog.queue_attachments(109, [{"type": "photo", "attachment": f"photo1_{index}", "url": f"https://example.test/{index}.jpg"} for index in range(6)])
confirmation = dialog.handle(109, "готово")
self.assertIn("подтверд", confirmation.lower())
self.assertEqual(len(dialog._states[109]["attachments"]), 6)
def test_photo_is_mirrored_before_history_save(self):
mirrored = []