Skip to content

Commit

Permalink
add typing for data in test_copy_feature_flag_missing_fields
Browse files Browse the repository at this point in the history
  • Loading branch information
jurajmajerik committed Nov 7, 2023
1 parent b9e0e65 commit d61a86f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 25 deletions.
24 changes: 0 additions & 24 deletions posthog/api/test/__snapshots__/test_organization_feature_flag.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -1500,30 +1500,6 @@
AND "posthog_featureflagdashboards"."feature_flag_id" = 2) /*controller='organization_feature_flags-copy-flags',route='api/organizations/%28%3FP%3Cparent_lookup_organization_id%3E%5B%5E/.%5D%2B%29/feature_flags/copy_flags/%3F%24'*/
'
---
# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.73
'
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
"posthog_dashboard"."description",
"posthog_dashboard"."team_id",
"posthog_dashboard"."pinned",
"posthog_dashboard"."created_at",
"posthog_dashboard"."created_by_id",
"posthog_dashboard"."deleted",
"posthog_dashboard"."last_accessed_at",
"posthog_dashboard"."filters",
"posthog_dashboard"."creation_mode",
"posthog_dashboard"."restriction_level",
"posthog_dashboard"."deprecated_tags",
"posthog_dashboard"."tags",
"posthog_dashboard"."share_token",
"posthog_dashboard"."is_shared"
FROM "posthog_dashboard"
INNER JOIN "posthog_featureflagdashboards" ON ("posthog_dashboard"."id" = "posthog_featureflagdashboards"."dashboard_id")
WHERE (NOT ("posthog_dashboard"."deleted")
AND "posthog_featureflagdashboards"."feature_flag_id" = 2) /*controller='organization_feature_flags-copy-flags',route='api/organizations/%28%3FP%3Cparent_lookup_organization_id%3E%5B%5E/.%5D%2B%29/feature_flags/copy_flags/%3F%24'*/
'
---
# name: TestOrganizationFeatureFlagCopy.test_copy_feature_flag_create_new.8
'
SELECT "posthog_featureflag"."id",
Expand Down
3 changes: 2 additions & 1 deletion posthog/api/test/test_organization_feature_flag.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from posthog.models.team.team import Team
from posthog.models import FeatureFlag
from posthog.test.base import APIBaseTest, QueryMatchingTest, snapshot_postgres_queries
from typing import Any, Dict


class TestOrganizationFeatureFlagGet(APIBaseTest, QueryMatchingTest):
Expand Down Expand Up @@ -194,7 +195,7 @@ def test_copy_feature_flag_update_existing(self):

def test_copy_feature_flag_missing_fields(self):
url = f"/api/organizations/{self.organization.id}/feature_flags/copy_flags"
data = {}
data: Dict[str, Any] = {}
response = self.client.post(url, data)

self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
Expand Down

0 comments on commit d61a86f

Please sign in to comment.