237
237
self.assertEqual(set(), found_subscriptions)
239
239
def test_structural(self):
240
# The set of structural subscriptions.
240
# The set of structural 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)
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
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
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
274
# self.assertEqual(subscriptions, found_subscriptions.sorted)
275
# self.assertEqual(subscribers, found_subscriptions.subscribers.sorted)
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