diff --git a/posthog/tasks/test/test_usage_report.py b/posthog/tasks/test/test_usage_report.py index e79c2c7a0e8b7..a99a6051b8b10 100644 --- a/posthog/tasks/test/test_usage_report.py +++ b/posthog/tasks/test/test_usage_report.py @@ -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, @@ -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) @@ -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: