Example #1
0
 def test_providesInterface(self):
     """BranchMergeProposalJob implements expected interfaces."""
     bmp = self.factory.makeBranchMergeProposal()
     job = BranchMergeProposalJob(
         bmp, BranchMergeProposalJobType.MERGE_PROPOSAL_NEEDS_REVIEW, {})
     job.sync()
     verifyObject(IBranchMergeProposalJob, job)
Example #2
0
 def deleteProposal(self):
     """See `IBranchMergeProposal`."""
     # Delete this proposal, but keep the superseded chain linked.
     if self.supersedes is not None:
         self.supersedes.superseded_by = self.superseded_by
     # Delete the related CodeReviewVoteReferences.
     for vote in self.votes:
         vote.destroySelf()
     # Delete the related CodeReviewComments.
     for comment in self.all_comments:
         comment.destroySelf()
     # Delete all jobs referring to the BranchMergeProposal, whether
     # or not they have completed.
     from lp.code.model.branchmergeproposaljob import BranchMergeProposalJob
     for job in BranchMergeProposalJob.selectBy(
             branch_merge_proposal=self.id):
         job.destroySelf()
     self._preview_diffs.remove()
     self.destroySelf()
 def deleteProposal(self):
     """See `IBranchMergeProposal`."""
     # Delete this proposal, but keep the superseded chain linked.
     if self.supersedes is not None:
         self.supersedes.superseded_by = self.superseded_by
     # Delete the related CodeReviewVoteReferences.
     for vote in self.votes:
         vote.destroySelf()
     # Delete the related CodeReviewComments.
     for comment in self.all_comments:
         comment.destroySelf()
     # Delete all jobs referring to the BranchMergeProposal, whether
     # or not they have completed.
     from lp.code.model.branchmergeproposaljob import BranchMergeProposalJob
     for job in BranchMergeProposalJob.selectBy(
         branch_merge_proposal=self.id):
         job.destroySelf()
     self._preview_diffs.remove()
     self.destroySelf()