Exemplo n.º 1
0
 def test_branch_modified(self):
     # Test the email headers for a branch modified email.
     bob = self.factory.makePerson(email='*****@*****.**')
     branch = self.factory.makeProductBranch(owner=bob)
     branch.getSubscription(bob).notification_level = (
         BranchSubscriptionNotificationLevel.FULL)
     mailer = BranchMailer.forBranchModified(branch, branch.owner, None)
     mailer.message_id = '<foobar-example-com>'
     ctrl = mailer.generateEmail('*****@*****.**', branch.owner)
     self.assertEqual(
         {
             'X-Launchpad-Branch': branch.unique_name,
             'X-Launchpad-Message-Rationale': 'Subscriber',
             'X-Launchpad-Notification-Type': 'branch-updated',
             'X-Launchpad-Project': branch.product.name,
             'Message-Id': '<foobar-example-com>'
         }, ctrl.headers)
Exemplo n.º 2
0
 def test_branch_modified(self):
     # Test the email headers for a branch modified email.
     bob = self.factory.makePerson(email="*****@*****.**")
     branch = self.factory.makeProductBranch(owner=bob)
     branch.getSubscription(bob).notification_level = BranchSubscriptionNotificationLevel.FULL
     mailer = BranchMailer.forBranchModified(branch, branch.owner, None)
     mailer.message_id = "<foobar-example-com>"
     ctrl = mailer.generateEmail("*****@*****.**", branch.owner)
     self.assertEqual(
         {
             "X-Launchpad-Branch": branch.unique_name,
             "X-Launchpad-Message-Rationale": "Subscriber",
             "X-Launchpad-Notification-Type": "branch-updated",
             "X-Launchpad-Project": branch.product.name,
             "Message-Id": "<foobar-example-com>",
         },
         ctrl.headers,
     )
Exemplo n.º 3
0
 def getMailer(self):
     """Return a `BranchMailer` for this job."""
     return BranchMailer.forBranchModified(
         self.branch, self.user, self.branch_delta)
Exemplo n.º 4
0
 def getMailer(self):
     """Return a `BranchMailer` for this job."""
     return BranchMailer.forBranchModified(
         self.repository, self.user, self.repository_delta,
         delta_for_editors=self.repository_delta_for_editors)