Skip to content

ref: prevent clobbering create_integration in base class #74809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/sentry/integrations/github/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class GithubSearchTest(APITestCase):
provider = "github"
base_url = "https://api.github.com"

def create_integration(self):
def _create_integration(self):
future = datetime.now() + timedelta(hours=1)
return self.create_provider_integration(
provider=self.provider,
Expand All @@ -32,7 +32,7 @@ def create_integration(self):

def setUp(self):
super().setUp()
self.integration = self.create_integration()
self.integration = self._create_integration()
identity = Identity.objects.create(
idp=self.create_identity_provider(type=self.provider),
user=self.user,
Expand Down
2 changes: 1 addition & 1 deletion tests/sentry/integrations/github_enterprise/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class GithubEnterpriseSearchTest(test_search.GithubSearchTest):
provider = "github_enterprise"
base_url = "https://github.example.org/api/v3"

def create_integration(self):
def _create_integration(self):
future = datetime.now() + timedelta(hours=1)
return self.create_provider_integration(
provider=self.provider,
Expand Down
10 changes: 5 additions & 5 deletions tests/sentry/integrations/opsgenie/test_notify_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
class OpsgenieNotifyTeamTest(RuleTestCase, PerformanceIssueTestCase):
rule_cls = OpsgenieNotifyTeamAction

def create_integration(self, name):
def _create_integration(self, name):
integration = self.create_provider_integration(
provider="opsgenie", name=name, external_id=name, metadata=METADATA
)
Expand All @@ -34,7 +34,7 @@ def create_integration(self, name):
def setUp(self):
self.team1 = {"id": "123-id", "team": "cool-team", "integration_key": "1234-5678"}
with assume_test_silo_mode(SiloMode.CONTROL):
self.integration = self.create_integration(name="test-app")
self.integration = self._create_integration(name="test-app")
with assume_test_silo_mode(SiloMode.CONTROL):
self.org_integration = OrganizationIntegration.objects.get(
organization_id=self.organization.id, integration_id=self.integration.id
Expand Down Expand Up @@ -170,7 +170,7 @@ def test_invalid_int_id(self):
def test_notifies_with_multiple_og_accounts(self):
team2 = {"id": "456-id", "team": "cooler-team", "integration_key": "1234-7890"}
with assume_test_silo_mode(SiloMode.CONTROL):
integration = self.create_integration("test-app-2")
integration = self._create_integration("test-app-2")
org_integration = OrganizationIntegration.objects.get(
organization_id=self.organization.id, integration_id=integration.id
)
Expand Down Expand Up @@ -213,7 +213,7 @@ def test_notifies_with_multiple_og_accounts(self):
def test_invalid_team_selected(self):
team2 = {"id": "456-id", "team": "cooler-team", "integration_key": "1234-7890"}
with assume_test_silo_mode(SiloMode.CONTROL):
integration = self.create_integration("test-app-2")
integration = self._create_integration("test-app-2")
org_integration = OrganizationIntegration.objects.get(
organization_id=self.organization.id, integration_id=integration.id
)
Expand Down Expand Up @@ -248,7 +248,7 @@ def test_bad_integration_key(self):
def test_team_deleted(self, mock_logger: MagicMock):
team2 = {"id": "456-id", "team": "cooler-team", "integration_key": "1234-7890"}
with assume_test_silo_mode(SiloMode.CONTROL):
integration = self.create_integration("test-app-2")
integration = self._create_integration("test-app-2")
org_integration = OrganizationIntegration.objects.get(
organization_id=self.organization.id, integration_id=integration.id
)
Expand Down
Loading