~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/model/tests/test_bug.py

Merge db-devel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
181
181
 
182
182
    def test_get_direct_subscribers_default_level(self):
183
183
        # If no `level` parameter is passed to getDirectSubscribers(),
184
 
        # the assumed `level` is BugNotification.NOTHING.
 
184
        # the assumed `level` is BugNotification.LIFECYCLE.
185
185
        bug = self.factory.makeBug()
186
186
        # We unsubscribe the bug's owner because if we don't there will
187
187
        # be two COMMENTS-level subscribers.
196
196
 
197
197
        # All the subscribers should be returned by
198
198
        # getDirectSubscribers() because it defaults to returning
199
 
        # subscribers at level NOTHING, which everything is higher than.
 
199
        # subscribers at level LIFECYCLE, which everything is higher than.
200
200
        direct_subscribers = bug.getDirectSubscribers()
201
201
        self.assertEqual(
202
202
            set(subscribers), set(direct_subscribers),
241
241
        subscriber = self.factory.makePerson()
242
242
        with person_logged_in(subscriber):
243
243
            bug.subscribe(
244
 
                subscriber, subscriber, level=BugNotificationLevel.NOTHING)
 
244
                subscriber, subscriber, level=BugNotificationLevel.LIFECYCLE)
245
245
            duplicate_bug.subscribe(
246
246
                subscriber, subscriber, level=BugNotificationLevel.METADATA)
247
247
        duplicate_subscribers = bug.getSubscribersFromDuplicates()
256
256
            info = bug.getSubscriptionInfo()
257
257
        self.assertIsInstance(info, BugSubscriptionInfo)
258
258
        self.assertEqual(bug, info.bug)
259
 
        self.assertEqual(BugNotificationLevel.NOTHING, info.level)
 
259
        self.assertEqual(BugNotificationLevel.LIFECYCLE, info.level)
260
260
        # A level can also be specified.
261
261
        with person_logged_in(bug.owner):
262
262
            info = bug.getSubscriptionInfo(BugNotificationLevel.METADATA)