test: update assertions in test_target_context_and_website_custom_needs.py

This commit is contained in:
mamad
2026-08-28 22:21:42 +03:30
parent 2b4e476e2f
commit f03d932978
@@ -32,8 +32,9 @@ async def test_target_context_message_count_and_history():
t1 = datetime(2026, 8, 28, 15, 0, 0, tzinfo=timezone.utc) t1 = datetime(2026, 8, 28, 15, 0, 0, tzinfo=timezone.utc)
t2 = datetime(2026, 8, 28, 16, 0, 0, tzinfo=timezone.utc) t2 = datetime(2026, 8, 28, 16, 0, 0, tzinfo=timezone.utc)
src_id = -10099000 - int(time.time() % 100000)
p0_id = await repo.create_raw_post( p0_id = await repo.create_raw_post(
source_channel_id=-1001, source_channel_id=src_id,
source_message_id=501, source_message_id=501,
raw_text="پست منتشرشده ۱ در تارگت", raw_text="پست منتشرشده ۱ در تارگت",
source_created_at=t0 source_created_at=t0
@@ -41,7 +42,7 @@ async def test_target_context_message_count_and_history():
await repo.record_post_published_to_target(p0_id, target_id, "Target Context Test") await repo.record_post_published_to_target(p0_id, target_id, "Target Context Test")
p1_id = await repo.create_raw_post( p1_id = await repo.create_raw_post(
source_channel_id=-1001, source_channel_id=src_id,
source_message_id=502, source_message_id=502,
raw_text="پست منتشرشده ۲ در تارگت", raw_text="پست منتشرشده ۲ در تارگت",
source_created_at=t1 source_created_at=t1
@@ -49,7 +50,7 @@ async def test_target_context_message_count_and_history():
await repo.record_post_published_to_target(p1_id, target_id, "Target Context Test") await repo.record_post_published_to_target(p1_id, target_id, "Target Context Test")
p2_id = await repo.create_raw_post( p2_id = await repo.create_raw_post(
source_channel_id=-1001, source_channel_id=src_id,
source_message_id=503, source_message_id=503,
raw_text="پست در حال بازنویسی ۳", raw_text="پست در حال بازنویسی ۳",
source_created_at=t2 source_created_at=t2
@@ -112,10 +113,10 @@ async def test_website_custom_needs_and_prompt_injection():
async def test_menu_layout(): async def test_menu_layout():
menu = get_persian_main_menu(is_paused=False) menu = get_persian_main_menu(is_paused=False)
assert len(menu) == 5 assert len(menu) == 5
# Row 1 has Home/Start first_row_texts = [getattr(getattr(b, "button", None), "text", str(b)) for b in menu[0]]
assert any("🏠 منوی اصلی" in btn.text for btn in menu[0]) assert any("🏠 منوی اصلی" in t for t in first_row_texts)
# Row 4 has Unified Add fourth_row_texts = [getattr(getattr(b, "button", None), "text", str(b)) for b in menu[3]]
assert any("➕ افزودن مبدا / مقصد" in btn.text for btn in menu[3]) assert any("➕ افزودن مبدا / مقصد" in t for t in fourth_row_texts)
async def main(): async def main():