fix: whatsapp businessFriendList needs page+departmentId+type

Live validation: businessFriendList uses 'page' (not pageNum) and REQUIRES
departmentId (root) + type or returns empty. Same class of bug as wxUser/list.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
浅念
2026-08-01 17:53:26 +08:00
parent 6ac47a1203
commit a57ed57616
3 changed files with 91 additions and 6 deletions
@@ -130,7 +130,12 @@ async def test_scrape_whatsapp_friends_sends_pagination_body():
client = _primed_client()
try:
results = [r async for r in scrape_whatsapp_friends(client, page_size=1)]
results = [
r
async for r in scrape_whatsapp_friends(
client, department_id="ROOT_DEPT", page_size=1
)
]
finally:
await client.aclose()
@@ -138,11 +143,14 @@ async def test_scrape_whatsapp_friends_sends_pagination_body():
assert route.call_count == 2
body1 = _json.loads(route.calls[0].request.content.decode())
assert body1["pageNum"] == 1
# businessFriendList uses `page` (not pageNum) + departmentId + type.
assert body1["page"] == 1
assert body1["pageSize"] == 1
assert body1["departmentId"] == "ROOT_DEPT"
assert body1["type"] == "0"
body2 = _json.loads(route.calls[1].request.content.decode())
assert body2["pageNum"] == 2
assert body2["page"] == 2
assert body2["pageSize"] == 1