Skip to content

Commit

Permalink
Update recordings list tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Twixes committed Sep 5, 2024
1 parent eeb4d0f commit 953e8fe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion posthog/models/event/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def bulk_create_events(
)

#  use person properties mapping to populate person properties in given event
team_id = event["team"].pk
team_id = event.get("team_id") or event.get("team").pk
person_mode = event.get("person_mode", "full")
if person_mapping and person_mapping.get(event["distinct_id"]):
person = person_mapping[event["distinct_id"]]
Expand Down
9 changes: 9 additions & 0 deletions posthog/session_recordings/queries/test/session_replay_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
KAFKA_LOG_ENTRIES,
)
from posthog.models.event.util import format_clickhouse_timestamp
from posthog.test.base import _create_event
from posthog.utils import cast_timestamp_or_now

INSERT_SINGLE_SESSION_REPLAY = """
Expand Down Expand Up @@ -146,6 +147,14 @@ def produce_replay_summary(
sql=INSERT_SINGLE_SESSION_REPLAY,
data=data,
)
# We also need to create a random analytics event, since sessions querying joins with events in
# any person-ID-on-events mode - sessions without an analytics event are excluded
_create_event(
distinct_id=data["distinct_id"],
event="foobarino",
properties={"$session_id": data["session_id"]},
team_id=team_id,
)

for level, messages in log_messages.items():
for message in messages:
Expand Down

0 comments on commit 953e8fe

Please sign in to comment.