def test_execute_bug_params_one_subscriber(self): user = self.factory.makePerson() login_person(user) subscriber = self.factory.makePerson() bug_params = CreateBugParams(title='bug title', owner=user) command = SubscribeEmailCommand('subscribe', [subscriber.name]) dummy_event = object() params, event = command.execute(bug_params, dummy_event) self.assertEqual(bug_params, params) self.assertContentEqual([subscriber], bug_params.subscribers) self.assertEqual(dummy_event, event)
def test_execute_bug_without_user_name(self): bug = self.factory.makeBug() target_owner = bug.bugtasks[0].target.owner login_person(target_owner) command = SubscribeEmailCommand('subscribe', []) dummy_event = object() exec_bug, event = command.execute(bug, dummy_event) self.assertEqual(bug, exec_bug) self.assertContentEqual([bug.owner, target_owner], bug.getDirectSubscribers()) self.assertEqual(dummy_event, event)
def test_execute_bug_without_user_name(self): bug = self.factory.makeBug() target_owner = bug.bugtasks[0].target.owner login_person(target_owner) command = SubscribeEmailCommand('subscribe', []) dummy_event = object() exec_bug, event = command.execute(bug, dummy_event) self.assertEqual(bug, exec_bug) self.assertContentEqual( [bug.owner, target_owner], bug.getDirectSubscribers()) self.assertEqual(dummy_event, event)