Пример #1
0
 def test_ReviewRequestedEmailJob(self):
     """ReviewRequestedEmailJob runs under Celery."""
     request = self.factory.makeCodeReviewVoteReference()
     self.useFixture(FeatureFixture(
         {'jobs.celery.enabled_classes': 'ReviewRequestedEmailJob'}))
     with block_on_job():
         ReviewRequestedEmailJob.create(request)
         transaction.commit()
     self.assertEqual(1, len(pop_remote_notifications()))
Пример #2
0
 def test_run_sends_mail(self):
     request = self.factory.makeCodeReviewVoteReference()
     job = ReviewRequestedEmailJob.create(request)
     job.run()
     (notification, ) = pop_notifications()
     self.assertIn('You have been requested to review the proposed merge',
                   notification.get_payload(decode=True))
 def test_run_sends_mail(self):
     request = self.factory.makeCodeReviewVoteReference()
     job = ReviewRequestedEmailJob.create(request)
     job.run()
     (notification,) = pop_notifications()
     self.assertIn(
         'You have been requested to review the proposed merge',
         notification.get_payload(decode=True))
Пример #4
0
 def test_getOperationDescription(self):
     request = self.factory.makeCodeReviewVoteReference()
     job = ReviewRequestedEmailJob.create(request)
     self.assertEqual(
         'emailing a reviewer requesting a review',
         job.getOperationDescription())
Пример #5
0
 def test_providesInterface(self):
     """ReviewRequestedEmailJob provides the expected interfaces."""
     request = self.factory.makeCodeReviewVoteReference()
     job = ReviewRequestedEmailJob.create(request)
     verifyObject(IReviewRequestedEmailJob, job)
     verifyObject(IBranchMergeProposalJob, job)