~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Stuart Bishop
  • Date: 2011-09-28 12:49:24 UTC
  • mfrom: (9893.10.1 trivial)
  • mto: This revision was merged to the branch mainline in revision 14178.
  • Revision ID: stuart.bishop@canonical.com-20110928124924-m5a22fymqghw6c5i
Merged trivial into distinct-db-users.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
from canonical.launchpad.webapp.publisher import canonical_url
19
19
from canonical.testing.layers import LaunchpadFunctionalLayer
20
20
from lp.bugs.enum import BugNotificationLevel
21
 
from lp.bugs.interfaces.bug import IBug
22
21
from lp.bugs.interfaces.bugtask import (
23
22
    BugTaskImportance,
24
23
    BugTaskStatus,
212
211
        self.saveOldChanges()
213
212
        # Only the user can unsubscribe him or her self.
214
213
        self.bug.unsubscribe(self.user, self.user)
 
214
 
 
215
        # This checks the activity's attribute and target attributes.
 
216
        activity = self.bug.activity[-1]
 
217
        self.assertEqual(activity.attribute, 'removed_subscriber')
 
218
        self.assertEqual(activity.target, None)
 
219
 
215
220
        unsubscribe_activity = dict(
216
221
            whatchanged='removed subscriber Arthur Dent',
217
222
            person=self.user)
549
554
    def test_make_private(self):
550
555
        # Marking a bug as private adds items to the bug's activity log
551
556
        # and notifications.
552
 
        bug_before_modification = Snapshot(self.bug, providing=IBug)
553
557
        self.bug.setPrivate(True, self.user)
554
 
        notify(ObjectModifiedEvent(
555
 
            self.bug, bug_before_modification, ['private'], self.user))
556
558
 
557
559
        visibility_change_activity = {
558
560
            'person': self.user,
577
579
        self.saveOldChanges(private_bug)
578
580
        self.assertTrue(private_bug.private)
579
581
 
580
 
        bug_before_modification = Snapshot(private_bug, providing=IBug)
581
582
        private_bug.setPrivate(False, self.user)
582
 
        notify(ObjectModifiedEvent(
583
 
            private_bug, bug_before_modification, ['private'], self.user))
584
583
 
585
584
        visibility_change_activity = {
586
585
            'person': self.user,
648
647
    def test_mark_as_security_vulnerability(self):
649
648
        # Marking a bug as a security vulnerability adds to the bug's
650
649
        # activity log and sends a notification.
651
 
        self.bug.setSecurityRelated(False)
 
650
        self.bug.setSecurityRelated(False, self.user)
652
651
        self.changeAttribute(self.bug, 'security_related', True)
653
652
 
654
653
        security_change_activity = {
672
671
    def test_unmark_as_security_vulnerability(self):
673
672
        # Unmarking a bug as a security vulnerability adds to the
674
673
        # bug's activity log and sends a notification.
675
 
        self.bug.setSecurityRelated(True)
 
674
        self.bug.setSecurityRelated(True, self.user)
 
675
        self.saveOldChanges()
676
676
        self.changeAttribute(self.bug, 'security_related', False)
677
677
 
678
678
        security_change_activity = {