исправление замечаний

This commit is contained in:
2026-10-10 00:22:30 +03:00
parent 1d02ee3f33
commit d0eaaea5b6
12 changed files with 144 additions and 46 deletions
+6 -2
View File
@@ -140,8 +140,12 @@ class MessengerApiTest(unittest.TestCase):
# Курсор правильной формы, но с испорченным временем/UUID: 400, а не ошибка БД (500).
import base64
import json
for bad in (["messages:" + chat_a["id"], "not-a-time", str(uuid.uuid4())],
["messages:" + chat_a["id"], "2026-01-01T00:00:00.000000Z", "not-a-uuid"]):
scope = "messages:" + chat_a["id"]
for bad in ([scope, "not-a-time", str(uuid.uuid4())],
[scope, "2026-01-01T00:00:00.000000Z", "not-a-uuid"],
[scope, "2026-01-01T00:00:00", str(uuid.uuid4())], # без часового пояса
[scope, "0001-01-01T00:00:00+14:00", str(uuid.uuid4())], # в UTC это год 0
[scope, "9999-12-31T23:59:59-14:00", str(uuid.uuid4())]): # в UTC это год 10000
forged = base64.urlsafe_b64encode(json.dumps(bad).encode()).decode()
self.api.call("GET", self.messages_path(chat_a["id"]) + "?cursor=" + forged, 400, actor=self.alice)
for limit in ("0", "101", "abc"):