Skip to content

Commit a37c036

Browse files
committed
fix the dedupe fake client test
1 parent c02c5d5 commit a37c036

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

posthog/personhog_client/test_fake_client.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,14 @@ def test_get_persons_by_distinct_ids_in_team(self):
6666
team_id=1, distinct_ids=["user@example.com", "anon-1", "user2@example.com"]
6767
)
6868
)
69-
assert len(resp.results) == 2
70-
person_ids = {r.person.id for r in resp.results}
71-
assert person_ids == {10, 20}
69+
# The real service returns one result per requested distinct_id (no dedup by person).
70+
# "user@example.com" and "anon-1" both map to person 10, so we get 3 results.
71+
assert len(resp.results) == 3
72+
assert [(r.distinct_id, r.person.id) for r in resp.results] == [
73+
("user@example.com", 10),
74+
("anon-1", 10),
75+
("user2@example.com", 20),
76+
]
7277

7378

7479
class TestFakePersonHogClientGroups:

0 commit comments

Comments
 (0)