~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/tests/test_bugchanges.py

Merge db-devel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
208
208
        # Unsubscribing someone from a bug adds an item to the activity
209
209
        # log, but doesn't send an e-mail notification.
210
210
        subscriber = self.factory.makePerson(displayname='Mom')
211
 
        bug_subscription = self.bug.subscribe(self.user, subscriber)
 
211
        self.bug.subscribe(self.user, subscriber)
212
212
        self.saveOldChanges()
213
213
        # Only the user can unsubscribe him or her self.
214
214
        self.bug.unsubscribe(self.user, self.user)
602
602
    def test_tags_added(self):
603
603
        # Adding tags to a bug will add BugActivity and BugNotification
604
604
        # entries.
605
 
        old_tags = self.changeAttribute(
 
605
        self.changeAttribute(
606
606
            self.bug, 'tags', ['first-new-tag', 'second-new-tag'])
607
607
 
608
608
        tag_change_activity = {
626
626
        # entries.
627
627
        self.bug.tags = ['first-new-tag', 'second-new-tag']
628
628
        self.saveOldChanges()
629
 
        old_tags = self.changeAttribute(
 
629
        self.changeAttribute(
630
630
            self.bug, 'tags', ['first-new-tag'])
631
631
 
632
632
        tag_change_activity = {
1017
1017
        target = self.factory.makeDistributionSourcePackage()
1018
1018
        metadata_subscriber = self.newSubscriber(
1019
1019
            target, "dsp-metadata", BugNotificationLevel.METADATA)
1020
 
        lifecycle_subscriber = self.newSubscriber(
 
1020
        self.newSubscriber(
1021
1021
            target, "dsp-lifecycle", BugNotificationLevel.LIFECYCLE)
1022
1022
        new_target = self.factory.makeDistributionSourcePackage(
1023
1023
            distribution=target.distribution)
1710
1710
        # do not get any bug email that they generated themselves.
1711
1711
        self.user.selfgenerated_bugnotifications = False
1712
1712
 
1713
 
        old_description = self.changeAttribute(
 
1713
        self.changeAttribute(
1714
1714
            self.bug, 'description', 'New description')
1715
1715
 
1716
1716
        # self.user is not included among the recipients.
1727
1727
 
1728
1728
        self.user.selfgenerated_bugnotifications = False
1729
1729
 
1730
 
        old_description = self.changeAttribute(
 
1730
        self.changeAttribute(
 
1731
            self.bug, 'description', 'New description')
 
1732
 
 
1733
        # self.user is not included among the recipients.
 
1734
        self.assertRecipients(
 
1735
            [self.product_metadata_subscriber, team.teamowner])
 
1736
 
 
1737
    def test_description_changed_no_muted_email(self):
 
1738
        # Users who have muted a bug do not get any bug email for a bug,
 
1739
        # even if they are subscribed through a team membership.
 
1740
        team = self.factory.makeTeam()
 
1741
        team.addMember(self.user, team.teamowner)
 
1742
        self.bug.subscribe(team, self.user)
 
1743
        self.bug.mute(self.user, self.user)
 
1744
 
 
1745
        self.changeAttribute(
1731
1746
            self.bug, 'description', 'New description')
1732
1747
 
1733
1748
        # self.user is not included among the recipients.
1741
1756
        self.bug.subscribe(self.product_metadata_subscriber,
1742
1757
                           self.product_metadata_subscriber,
1743
1758
                           level=BugNotificationLevel.LIFECYCLE)
1744
 
        old_description = self.changeAttribute(
 
1759
        self.changeAttribute(
1745
1760
            self.bug, 'description', 'New description')
1746
1761
 
1747
1762
        # self.product_metadata_subscriber is not included among the