~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/code/mail/tests/test_branchmergeproposal.py

[r=abentley,
        rvb][no-qa] UpdatePreviewDiffJob now issues an ObjectModifiedEvent
        when it updates the preview_diff.

Show diffs side-by-side

added added

removed removed

Lines of Context:
407
407
        merge_proposal_modified(merge_proposal, event)
408
408
        self.assertIs(None, self.getProposalUpdatedEmailJob(merge_proposal))
409
409
 
 
410
    def test_no_job_created_if_only_preview_diff_changed(self):
 
411
        """Ensure None is returned if only the preview diff has changed."""
 
412
        merge_proposal, person = self.makeProposalWithSubscriber()
 
413
        old_merge_proposal = Snapshot(
 
414
            merge_proposal, providing=providedBy(merge_proposal))
 
415
        merge_proposal.updatePreviewDiff(
 
416
            ''.join(unified_diff('', 'Fake diff')),
 
417
            unicode(self.factory.getUniqueString('revid')),
 
418
            unicode(self.factory.getUniqueString('revid')))
 
419
        event = ObjectModifiedEvent(
 
420
            merge_proposal, old_merge_proposal, [], merge_proposal.registrant)
 
421
        merge_proposal_modified(merge_proposal, event)
 
422
        self.assertIs(None, self.getProposalUpdatedEmailJob(merge_proposal))
 
423
 
410
424
    def test_no_job_created_if_work_in_progress(self):
411
425
        """Ensure None is returned if no change has been made."""
412
426
        merge_proposal, person = self.makeProposalWithSubscriber(