Fix account enrollment and operator callback flows with Redis scenarios
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2026-09-14 21:01:56 +09:00
parent f3f8d0f737
commit a9af9cb010
17 changed files with 678 additions and 167 deletions

View File

@@ -7,7 +7,7 @@ from sqlalchemy import select
from src.core.access import get_role
from src.core.database import async_session_maker
from src.core.models import User
from src.core.services import UserService
from src.core.services import LotteryService, UserService
from src.core.staff_service import StaffError, change_role, get_member
from test_dispatcher import dispatch, event
@@ -104,8 +104,11 @@ async def test_actual_ordinary_admin_and_cashier_cannot_forge_staff_callback(act
async def test_revoked_cashier_cannot_continue_open_participant_dialog():
await create_user(819, is_cashier=True)
await dispatch(event(819, callback_data="cash_add:1"))
cashier = await create_user(819, is_cashier=True)
async with async_session_maker() as session:
lottery = await LotteryService.create_lottery(session, "Open draw", "", ["Prize"], cashier.id)
lottery_id = lottery.id
await dispatch(event(819, callback_data=f"cash_add:{lottery_id}"))
await change_role(900001, 819, "user", (False, True))
calls = await dispatch(event(819, text="11-22-33-44-55-66-77"))
assert any("Недостаточно прав" in (getattr(call, "text", "") or "") for call in calls)