211
211
self.assertEqual(set(), found_subscriptions)
213
213
def test_structural(self):
214
# The set of structural subscribers.
214
# The set of structural subscriptions.
216
216
self.factory.makePerson(),
217
217
self.factory.makePerson())
225
225
self.assertEqual(set(subscribers), found_subscriptions.subscribers)
226
226
self.assertEqual(subscribers, found_subscriptions.subscribers.sorted)
228
def test_structural_subscriptions_from_duplicates(self):
229
# The set of structural subscriptions from duplicates.
230
subscribers = (self.factory.makePerson(), self.factory.makePerson())
231
# Note that this duplicate_bug will have a different target than the
233
duplicate_bug = self.factory.makeBug()
234
with person_logged_in(duplicate_bug.owner):
235
duplicate_bug.markAsDuplicate(self.bug)
236
target = duplicate_bug.default_bugtask.target
238
for subscriber in subscribers:
239
with person_logged_in(subscriber):
240
subscriptions.append(target.addBugSubscription(
241
subscriber, subscriber))
242
found_subscriptions = (
243
self.getInfo().structural_subscriptions_from_duplicates)
244
self.assertEqual(set(subscriptions), found_subscriptions)
245
self.assertEqual(set(subscribers), found_subscriptions.subscribers)
246
# There's no particular order of our subscriptions, so sorted does
248
# self.assertEqual(subscriptions, found_subscriptions.sorted)
249
# self.assertEqual(subscribers, found_subscriptions.subscribers.sorted)
228
251
def test_all_assignees(self):
229
252
# The set of bugtask assignees for bugtasks that have been assigned.
230
253
found_assignees = self.getInfo().all_assignees