def METHOD_NAME(self, mock_delete_repo):
    mock_delete_repo.side_effect = PluginError("foo")
    org = self.create_organization()
    repo = Repository.objects.create(
        organization_id=org.id,
        provider="dummy",
        name="example/example",
        status=ObjectStatus.PENDING_DELETION,
    )
    self.ScheduledDeletion.schedule(instance=repo, actor=self.user, days=0)
    with self.tasks():
        run_scheduled_deletions()
    msg = mail.outbox[-1]
    assert msg.subject == "Unable to Delete Repository Webhooks"
    assert msg.to == [self.user.email]
    assert "foo" in msg.body
    assert not Repository.objects.filter(id=repo.id).exists()