From d249aeeb95c01e587eae93a49657d118714d8bf9 Mon Sep 17 00:00:00 2001 From: Michael Matloka Date: Fri, 20 Dec 2024 19:00:15 +0100 Subject: [PATCH] Fix some tests --- ee/billing/test/test_quota_limiting.py | 4 ++-- .../test/subscriptions/test_slack_subscriptions.py | 10 +++++----- posthog/models/test/test_user_model.py | 4 ++-- posthog/tasks/test/test_periodic_digest.py | 4 ++-- posthog/tasks/test/test_plugin_server.py | 2 +- posthog/tasks/test/test_usage_report.py | 6 +++--- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ee/billing/test/test_quota_limiting.py b/ee/billing/test/test_quota_limiting.py index fedf7b15a54ec..b08fd9803cb38 100644 --- a/ee/billing/test/test_quota_limiting.py +++ b/ee/billing/test/test_quota_limiting.py @@ -77,7 +77,7 @@ def test_quota_limiting_feature_flag_enabled(self, patch_feature_enabled, patch_ org_id, "quota limiting suspended", properties={"current_usage": 109}, - groups={"instance": "http://localhost:8000", "organization": org_id}, + groups={"instance": "http://localhost:8010", "organization": org_id}, ) # Feature flag is enabled so they won't be limited. assert quota_limited_orgs["events"] == {} @@ -222,7 +222,7 @@ def test_billing_rate_limit(self, patch_capture) -> None: "quota_limited_recordings": 1612137599, "quota_limited_rows_synced": None, }, - groups={"instance": "http://localhost:8000", "organization": org_id}, + groups={"instance": "http://localhost:8010", "organization": org_id}, ) assert self.redis_client.zrange(f"@posthog/quota-limits/events", 0, -1) == [ diff --git a/ee/tasks/test/subscriptions/test_slack_subscriptions.py b/ee/tasks/test/subscriptions/test_slack_subscriptions.py index 758f74cd3b2d1..b340843549298 100644 --- a/ee/tasks/test/subscriptions/test_slack_subscriptions.py +++ b/ee/tasks/test/subscriptions/test_slack_subscriptions.py @@ -68,12 +68,12 @@ def test_subscription_delivery(self, MockSlackIntegration: MagicMock) -> None: { "type": "button", "text": {"type": "plain_text", "text": "View in PostHog"}, - "url": "http://localhost:8000/insights/123456?utm_source=posthog&utm_campaign=subscription_report&utm_medium=slack", + "url": "http://localhost:8010/insights/123456?utm_source=posthog&utm_campaign=subscription_report&utm_medium=slack", }, { "type": "button", "text": {"type": "plain_text", "text": "Manage Subscription"}, - "url": f"http://localhost:8000/insights/123456/subscriptions/{self.subscription.id}?utm_source=posthog&utm_campaign=subscription_report&utm_medium=slack", + "url": f"http://localhost:8010/insights/123456/subscriptions/{self.subscription.id}?utm_source=posthog&utm_campaign=subscription_report&utm_medium=slack", }, ], }, @@ -141,12 +141,12 @@ def test_subscription_dashboard_delivery(self, MockSlackIntegration: MagicMock) { "type": "button", "text": {"type": "plain_text", "text": "View in PostHog"}, - "url": f"http://localhost:8000/dashboard/{self.dashboard.id}?utm_source=posthog&utm_campaign=subscription_report&utm_medium=slack", + "url": f"http://localhost:8010/dashboard/{self.dashboard.id}?utm_source=posthog&utm_campaign=subscription_report&utm_medium=slack", }, { "type": "button", "text": {"type": "plain_text", "text": "Manage Subscription"}, - "url": f"http://localhost:8000/dashboard/{self.dashboard.id}/subscriptions/{self.subscription.id}?utm_source=posthog&utm_campaign=subscription_report&utm_medium=slack", + "url": f"http://localhost:8010/dashboard/{self.dashboard.id}/subscriptions/{self.subscription.id}?utm_source=posthog&utm_campaign=subscription_report&utm_medium=slack", }, ], }, @@ -181,7 +181,7 @@ def test_subscription_dashboard_delivery(self, MockSlackIntegration: MagicMock) "type": "section", "text": { "type": "mrkdwn", - "text": f"Showing 3 of 10 Insights. ", + "text": f"Showing 3 of 10 Insights. ", }, } ] diff --git a/posthog/models/test/test_user_model.py b/posthog/models/test/test_user_model.py index 53a83fd2a27f9..a1cd137facb43 100644 --- a/posthog/models/test/test_user_model.py +++ b/posthog/models/test/test_user_model.py @@ -40,7 +40,7 @@ def test_analytics_metadata(self): "has_social_auth": False, "social_providers": [], "strapi_id": None, - "instance_url": "http://localhost:8000", + "instance_url": "http://localhost:8010", "instance_tag": "none", "is_email_verified": None, "has_seen_product_intro_for": None, @@ -76,7 +76,7 @@ def test_analytics_metadata(self): "has_social_auth": False, "social_providers": [], "strapi_id": None, - "instance_url": "http://localhost:8000", + "instance_url": "http://localhost:8010", "instance_tag": "none", "is_email_verified": None, "has_seen_product_intro_for": None, diff --git a/posthog/tasks/test/test_periodic_digest.py b/posthog/tasks/test/test_periodic_digest.py index a4fed64b0b8f6..50e4597f9c102 100644 --- a/posthog/tasks/test/test_periodic_digest.py +++ b/posthog/tasks/test/test_periodic_digest.py @@ -126,7 +126,7 @@ def test_periodic_digest_report(self, mock_capture: MagicMock) -> None: "plugins_installed": {}, "product": "open source", "realm": "hosted-clickhouse", - "site_url": "http://localhost:8000", + "site_url": "http://localhost:8010", "table_sizes": ANY, "clickhouse_version": ANY, "deployment_infrastructure": "unknown", @@ -240,7 +240,7 @@ def test_periodic_digest_report_custom_dates(self, mock_capture: MagicMock) -> N "plugins_installed": {}, "product": "open source", "realm": "hosted-clickhouse", - "site_url": "http://localhost:8000", + "site_url": "http://localhost:8010", "table_sizes": ANY, "clickhouse_version": ANY, "deployment_infrastructure": "unknown", diff --git a/posthog/tasks/test/test_plugin_server.py b/posthog/tasks/test/test_plugin_server.py index cf03f845e684d..b2cda79c6c22a 100644 --- a/posthog/tasks/test/test_plugin_server.py +++ b/posthog/tasks/test/test_plugin_server.py @@ -25,7 +25,7 @@ def test_tracks_events_regardless(self, mock_report_action: MagicMock, MockEmail "hog function state changed", { "hog_function_id": str(hog_function.id), - "hog_function_url": f"http://localhost:8000/project/{hog_function.team.id}/pipeline/destinations/hog-{str(hog_function.id)}", + "hog_function_url": f"http://localhost:8010/project/{hog_function.team.id}/pipeline/destinations/hog-{str(hog_function.id)}", "state": 1, }, ) diff --git a/posthog/tasks/test/test_usage_report.py b/posthog/tasks/test/test_usage_report.py index 6215af18f6821..d5b2a8b1777a5 100644 --- a/posthog/tasks/test/test_usage_report.py +++ b/posthog/tasks/test/test_usage_report.py @@ -1591,7 +1591,7 @@ def test_send_usage_cloud(self, mock_post: MagicMock, mock_client: MagicMock) -> "organization usage report", {**full_report_as_dict, "scope": "user"}, groups={ - "instance": "http://localhost:8000", + "instance": "http://localhost:8010", "organization": str(self.organization.id), }, timestamp=None, @@ -1703,7 +1703,7 @@ def test_capture_report_transforms_team_id_to_org_id(self, mock_client: MagicMoc self.user.distinct_id, "test event", {**report, "scope": "user"}, - groups={"instance": "http://localhost:8000", "organization": str(self.organization.id)}, + groups={"instance": "http://localhost:8010", "organization": str(self.organization.id)}, timestamp=None, ) @@ -1722,7 +1722,7 @@ def test_capture_report_transforms_team_id_to_org_id(self, mock_client: MagicMoc self.user.distinct_id, "test event", {**report, "scope": "user"}, - groups={"instance": "http://localhost:8000", "organization": str(self.organization.id)}, + groups={"instance": "http://localhost:8010", "organization": str(self.organization.id)}, timestamp=None, )