1414from sentry .models .projectcodeowners import ProjectCodeOwners
1515from sentry .models .pullrequest import CommentType , PullRequest , PullRequestComment
1616from sentry .models .repository import Repository
17+ from sentry .seer .models .project_repository import SeerProjectRepository
1718from sentry .testutils .cases import TransactionTestCase
1819from sentry .testutils .hybrid_cloud import HybridCloudTestMixin
1920
2021
2122class DeleteRepositoryTest (TransactionTestCase , HybridCloudTestMixin ):
2223 def test_simple (self ) -> None :
2324 org = self .create_organization ()
25+ project = self .create_project (organization = org )
2426 repo = Repository .objects .create (
2527 organization_id = org .id ,
2628 provider = "dummy" ,
@@ -63,6 +65,10 @@ def test_simple(self) -> None:
6365 created_at = timezone .now (),
6466 updated_at = timezone .now (),
6567 )
68+ seer_project_repo = SeerProjectRepository .objects .create (
69+ project = project ,
70+ repository = repo ,
71+ )
6672
6773 self .ScheduledDeletion .schedule (instance = repo , days = 0 )
6874
@@ -73,6 +79,7 @@ def test_simple(self) -> None:
7379 assert not Commit .objects .filter (id = commit .id ).exists ()
7480 assert not PullRequest .objects .filter (id = pull .id ).exists ()
7581 assert not PullRequestComment .objects .filter (id = comment .id ).exists ()
82+ assert not SeerProjectRepository .objects .filter (id = seer_project_repo .id ).exists ()
7683 assert Commit .objects .filter (id = commit2 .id ).exists ()
7784
7885 def test_codeowners (self ) -> None :
0 commit comments