Косметические правки по фронту, раскатка приложения в продакшн версии, исправление бага с созданием контакта
This commit is contained in:
@@ -304,7 +304,11 @@ async def test_openlines_payload_gets_fresh_download_url_without_storage_fields(
|
||||
"message_id": str(uuid.uuid4()),
|
||||
"external_chat_id": str(uuid.uuid4()),
|
||||
"occurred_at": "2026-07-10T12:00:00+00:00",
|
||||
"user": {"id": str(uuid.uuid4()), "display_name": "+79990000000"},
|
||||
"user": {
|
||||
"id": str(uuid.uuid4()),
|
||||
"display_name": "Новый клиент HAN",
|
||||
"phone": "+79990000000",
|
||||
},
|
||||
"message": {
|
||||
"content_kind": "file",
|
||||
"text": "",
|
||||
|
||||
@@ -20,6 +20,7 @@ from app.schemas import (
|
||||
from app.services import (
|
||||
MESSAGE_SAFETY_REPLIES,
|
||||
ensure_delivery_outbox,
|
||||
openlines_user_payload,
|
||||
safety_reply_message,
|
||||
safety_task_recovery_at,
|
||||
)
|
||||
@@ -85,6 +86,20 @@ def test_safety_recovery_starts_after_synchronous_polling_window() -> None:
|
||||
assert (safety_task_recovery_at(now, settings) - now).total_seconds() == 307
|
||||
|
||||
|
||||
def test_openlines_user_payload_uses_profile_name_and_phone() -> None:
|
||||
user = SimpleNamespace(id=uuid.uuid4(), phone_number="+79991234567")
|
||||
named = openlines_user_payload(user, SimpleNamespace(full_name="Иван Иванов"))
|
||||
assert named == {
|
||||
"id": str(user.id),
|
||||
"display_name": "Иван Иванов",
|
||||
"phone": "+79991234567",
|
||||
}
|
||||
assert openlines_user_payload(user, SimpleNamespace(full_name=" "))["display_name"] == (
|
||||
"Новый клиент HAN"
|
||||
)
|
||||
assert openlines_user_payload(user, None)["display_name"] == "Новый клиент HAN"
|
||||
|
||||
|
||||
async def test_delivery_outbox_returns_concurrent_insert_winner() -> None:
|
||||
existing = object()
|
||||
session = SimpleNamespace(
|
||||
|
||||
Reference in New Issue
Block a user