feat(tradein/avito): house-поля с детальной страницы доезжают в houses (#3036) #3040

Merged
bot-backend merged 2 commits from feat/3036-detail-house-params into main 2026-08-21 14:48:36 +00:00
Showing only changes of commit 2f28f0166e - Show all commits

View file

@ -156,16 +156,20 @@ def test_live_fill_only_then_keep_then_unlinked_untouched() -> None:
db.execute(text("DELETE FROM houses WHERE source='test' AND ext_house_id LIKE 't3036-%'"))
hid = db.execute(
text(
"INSERT INTO houses (source, ext_house_id, address) "
"VALUES ('test', 't3036-h1', 'ул. Тестовая, 1') RETURNING id"
"INSERT INTO houses (source, ext_house_id, url, address) "
"VALUES ('test', 't3036-h1', 'https://example.test/houses/t3036-h1', "
"'ул. Тестовая, 1') RETURNING id"
)
).scalar_one()
db.execute(
text(
"INSERT INTO listings "
"(source, source_id, address, price_rub, house_id_fk, is_active) "
"VALUES ('avito', 't3036-1', 'ул. Тестовая, 1', 5000000, :hid, true), "
" ('avito', 't3036-2', 'ул. Тестовая, 2', 5000000, NULL, true)"
"(source, source_id, source_url, dedup_hash, address, price_rub, "
" house_id_fk, is_active) "
"VALUES ('avito', 't3036-1', 'https://www.avito.ru/x/t3036-1', 't3036-dh-1', "
" 'ул. Тестовая, 1', 5000000, :hid, true), "
" ('avito', 't3036-2', 'https://www.avito.ru/x/t3036-2', 't3036-dh-2', "
" 'ул. Тестовая, 2', 5000000, NULL, true)"
),
{"hid": hid},
)