~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

[r=wgrant][rollback=13154] Revert r13154. It breaks bugs with
 duplicate team subscriptions. Or something.

Show diffs side-by-side

added added

removed removed

Lines of Context:
237
237
        self.assertEqual(set(), found_subscriptions)
238
238
 
239
239
    def test_structural(self):
240
 
        # The set of structural subscriptions.
 
240
        # The set of structural subscribers.
241
241
        subscribers = (
242
242
            self.factory.makePerson(),
243
243
            self.factory.makePerson())
251
251
        self.assertEqual(set(subscribers), found_subscriptions.subscribers)
252
252
        self.assertEqual(subscribers, found_subscriptions.subscribers.sorted)
253
253
 
254
 
    def test_structural_subscriptions_from_duplicates(self):
255
 
        # The set of structural subscriptions from duplicates.
256
 
        subscribers = (self.factory.makePerson(), self.factory.makePerson())
257
 
        # Note that this duplicate_bug will have a different target than the
258
 
        # main bug's.
259
 
        duplicate_bug = self.factory.makeBug()
260
 
        with person_logged_in(duplicate_bug.owner):
261
 
            duplicate_bug.markAsDuplicate(self.bug)
262
 
        target = duplicate_bug.default_bugtask.target
263
 
        subscriptions = []
264
 
        for subscriber in subscribers:
265
 
            with person_logged_in(subscriber):
266
 
                subscriptions.append(target.addBugSubscription(
267
 
                    subscriber, subscriber))
268
 
        found_subscriptions = (
269
 
            self.getInfo().structural_subscriptions_from_duplicates)
270
 
        self.assertEqual(set(subscriptions), found_subscriptions)
271
 
        self.assertEqual(set(subscribers), found_subscriptions.subscribers)
272
 
        # There's no particular order of our subscriptions, so sorted does
273
 
        # not compare.
274
 
        # self.assertEqual(subscriptions, found_subscriptions.sorted)
275
 
        # self.assertEqual(subscribers, found_subscriptions.subscribers.sorted)
276
 
 
277
254
    def test_all_assignees(self):
278
255
        # The set of bugtask assignees for bugtasks that have been assigned.
279
256
        found_assignees = self.getInfo().all_assignees