Проблема: POST /custom-pois возвращал 201 с id=N, но row не сохранялась в БД — user_custom_pois оставалась пустой после request close. Симптом возникает если service-функция не вызывает db.commit() явно: get_db.finally → db.close() без commit → psycopg3 rollbacks pending tx. Код (#257) содержит db.commit() во всех 3 мутациях, но тесты полностью мокировали service layer через patch() — regression в commit не ловился. Fix: добавлены 6 service-level тестов с паттерном "два сеанса": - MagicMock(db) + db.commit.assert_called_once() для create/update/delete - db.commit.assert_not_called() для not-found и empty-payload случаев Closes #261 |
||
|---|---|---|
| .. | ||
| api | ||
| integration | ||
| scrapers | ||
| services | ||
| smoke | ||
| workers | ||
| __init__.py | ||
| test_admin_weight_profiles.py | ||
| test_concepts_stub.py | ||
| test_gate_verdict.py | ||
| test_health.py | ||
| test_layout_signature.py | ||
| test_layout_tz_pdf.py | ||
| test_nspd_client.py | ||
| test_nspd_sync.py | ||
| test_quarter_dump_lookup.py | ||
| test_sentry_init.py | ||
| test_velocity.py | ||
| test_weight_profiles.py | ||