Skip to content

Commit

Permalink
chore: add some clarifying test assertions (#23106)
Browse files Browse the repository at this point in the history
Co-authored-by: Manoel Aranda Neto <[email protected]>
  • Loading branch information
pauldambra and marandaneto authored Jun 28, 2024
1 parent 0a52d30 commit 72530cc
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion posthog/tasks/test/test_usage_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
capture_event,
get_instance_metadata,
send_all_org_usage_reports,
OrgReport,
_add_team_report_to_org_reports,
)
from posthog.test.base import (
APIBaseTest,
Expand Down Expand Up @@ -673,9 +675,14 @@ def test_usage_report_replay(self) -> None:
report = _get_team_report(all_reports, self.team)

assert report.recording_count_in_period == 5

assert report.mobile_recording_count_in_period == 0

org_reports: dict[str, OrgReport] = {}
_add_team_report_to_org_reports(org_reports, self.team, report, period_start)

assert org_reports[str(self.organization.id)].recording_count_in_period == 5
assert org_reports[str(self.organization.id)].mobile_recording_count_in_period == 0

def test_usage_report_replay_with_mobile(self) -> None:
_setup_replay_data(self.team.pk, include_mobile_replay=True)

Expand All @@ -689,6 +696,12 @@ def test_usage_report_replay_with_mobile(self) -> None:
assert report.recording_count_in_period == 5
assert report.mobile_recording_count_in_period == 1

org_reports: dict[str, OrgReport] = {}
_add_team_report_to_org_reports(org_reports, self.team, report, period_start)

assert org_reports[str(self.organization.id)].recording_count_in_period == 5
assert org_reports[str(self.organization.id)].mobile_recording_count_in_period == 1


class HogQLUsageReport(APIBaseTest, ClickhouseTestMixin, ClickhouseDestroyTablesMixin):
def test_usage_report_hogql_queries(self) -> None:
Expand Down

0 comments on commit 72530cc

Please sign in to comment.