Цель: на локальном stack проверить, что backend, auth, seed, основной API и chat service работают воспроизводимо.
Эта страница фиксирует сценарии и pass/fail criteria. Конкретные HTTP payloads и одноразовые тестовые запросы здесь намеренно не хранятся; фактические request shapes нужно брать из Swagger UI, API contract и текущих serializers.
cd django_around/around
cp .env.example .env
Для проверки именно docker-compose.local.yml рекомендуется явно выставить в .env:
CHAT_HTTP_PORT=8998
MOBIZON_ENABLED=0
DJANGO_SECRET_KEY=change-me
Без этого CHAT_HTTP_PORT из .env.example равен 20001, и chat local URL будет отличаться от стандартной таблицы local compose.
docker compose -f docker-compose.local.yml up --build -d
docker compose -f docker-compose.local.yml ps
Ожидаемо:
around_back запущен;
around_chat запущен;
around_db healthy;
around_redis запущен;
- workers и beat не уходят в restart loop.
¶ 3. Health And Schema
Проверить:
- Django OpenAPI schema endpoint отвечает
200.
- Swagger UI открывается и показывает Django + chat schema.
- Chat service health endpoint отвечает
200 and reports ok status.
Fail criteria:
- schema endpoint возвращает
500;
- Swagger UI не открывается;
- chat health не отвечает;
- в логах
around_back или around_chat есть startup/runtime errors.
docker compose -f docker-compose.local.yml exec around_back python manage.py seed_demo_data --reset-demo
Ожидаемо в выводе:
Demo data seeded.
- provider phone
+77000001001;
- client phone
+77000001002;
Job sheet: #...;
Orders/events: ....
Seed создает provider/client, profile/address/calendar, currency, demo payment provider, user card, job sheet, job item и набор job events/orders по статусам.
¶ 5. Auth And Tokens
Проверить:
- client login по seeded client user выпускает OTP response;
- при
MOBIZON_ENABLED=0 OTP равен 0000;
- verify-code возвращает
access, refresh, token_type="Bearer" and user;
- тот же flow работает для seeded provider user;
- refresh endpoint обновляет tokens;
- logout blacklist-ит refresh token.
Fail criteria:
- login для seeded users возвращает
404/401;
- verify-code не выпускает access token;
- refresh token принимается там, где нужен access token.
¶ 6. Profile And Discovery
Проверить:
- current user endpoint возвращает phone/profile fields and address data;
- nearby search с валидным query возвращает seeded job sheet;
- nearby search возвращает provider address fields;
- query короче 3 символов возвращает validation error;
- пользователь без адреса получает expected domain error for nearby search.
Некоторые flows требуют database ids, которых нет в public auth response:
- numeric
User.id for chat peer_user_id;
- job sheet id;
- job instance id;
- user card id;
- currency id.
Получать ids можно из seed output, Django admin, Django shell или database viewer. Chat peer_user_id требует числовой User.id, не uuid.
Проверить:
- client can create a job event for seeded job sheet and job item;
- response contains event, order and
status="created";
- if
user_card_id is absent or invalid for the user, order status becomes pending_payment_method;
- client approve action moves event to
pending;
- status actions reject non-empty body when the action requires an empty body.
Fail criteria:
- event creation fails for valid seeded data;
- order is not created;
- status action accepts invalid body;
- actor restrictions are not enforced.
¶ 9. Favorites, Reviews And Feedback
Favorites:
- add seeded sheet to favorites;
- favorite response marks
is_favorite=true;
- favorites list includes the sheet;
- removing favorite clears
is_favorite.
Reviews:
- authenticated user can create review for seeded sheet;
- rating must be within 1..5;
- reviews can be filtered by
base_sheet;
- create/update/delete recalculates sheet
rating and review_count.
Feedback:
- authenticated user can create feedback with text;
- repeated feedback inside the throttle window returns validation/throttle error.
¶ 10. Push And Billing
Push:
- push status endpoint reports notifications module available;
- authenticated user can register a device token;
- device list returns only active devices of current user;
- unregister deactivates the device;
- real delivery is out of local smoke unless
FIREBASE_ENABLED=1 and credentials are configured.
Billing:
- card bank reference endpoint returns
200;
- card payment systems endpoint returns
200;
- if reference lists are empty, run
python manage.py seed_kz_card_banks;
- current user cards endpoint returns a list and supports
usage=client|business;
- mock/random card bind works for local non-provider checks;
- FreedomPay redirect/tokenization flow is not mandatory for local smoke unless provider credentials are configured.
- migration creates enabled
Daily settlement of due events in Django admin;
- a past
done event with funds_holded order invokes clearing and becomes success when provider calls are mocked;
- a past non-
done event with funds_holded order invokes reverse and becomes canceled;
- a pending move request does not exclude a past event, while an accepted move with a future date does;
- a provider error leaves the order in
funds_holded for the next run.
Проверить:
- authenticated user can list chats;
- client can create 1:1 chat with provider numeric
User.id;
- repeated create is idempotent;
- self-chat is rejected;
- messages history endpoint is accessible for chat participant.
Fail criteria:
- refresh token is accepted by chat API;
- non-participant can access messages;
- self-chat creates a row.
Проверить:
- WebSocket connects with access token;
- ping command receives pong response;
- invalid or refresh token is rejected;
- two verified users can connect simultaneously for manual message delivery check;
- reconnect with
last_event_id does not break connection.
Для проверки доставки сообщений нужны два verified пользователя, два access token и два WebSocket connections.
django_around/test_requests.http не является эталонным smoke file: в нем есть hardcoded tokens, старый port 8000 и payload fields, которые уже не соответствуют текущим serializers.
/api/v1/uploads/photos есть в OpenAPI fragment, но handler в Go router отсутствует.
- Hot ads требуют
icon, location, currency; для ручной проверки эти справочники нужно подготовить через admin/seed/shell.