def test_execute_bug(self): bug = self.factory.makeBug() login_person(bug.owner) command = PrivateEmailCommand('private', ['yes']) exec_bug, event = command.execute(bug, None) self.assertEqual(bug, exec_bug) self.assertEqual(True, bug.private) self.assertTrue(IObjectModifiedEvent.providedBy(event))
def test_execute_bug_params(self): user = self.factory.makePerson() login_person(user) bug_params = CreateBugParams(title='bug title', owner=user) command = PrivateEmailCommand('private', ['yes']) dummy_event = object() params, event = command.execute(bug_params, dummy_event) self.assertEqual(bug_params, params) self.assertEqual(InformationType.USERDATA, bug_params.information_type) self.assertEqual(dummy_event, event)
def test_execute_bug_params(self): user = self.factory.makePerson() login_person(user) bug_params = CreateBugParams(title='bug title', owner=user) command = PrivateEmailCommand('private', ['yes']) dummy_event = object() params, event = command.execute(bug_params, dummy_event) self.assertEqual(bug_params, params) self.assertEqual( InformationType.USERDATA, bug_params.information_type) self.assertEqual(dummy_event, event)
def test_execute_bug_params_with_security(self): # BugSet.createBug() requires new security bugs to be private. user = self.factory.makePerson() login_person(user) bug_params = CreateBugParams( title='bug title', owner=user, information_type=InformationType.PRIVATESECURITY) command = PrivateEmailCommand('private', ['no']) dummy_event = object() params, event = command.execute(bug_params, dummy_event) self.assertEqual(bug_params, params) self.assertEqual( InformationType.PRIVATESECURITY, bug_params.information_type) self.assertEqual(dummy_event, event)
def test_execute_bug_params_with_security(self): # BugSet.createBug() requires new security bugs to be private. user = self.factory.makePerson() login_person(user) bug_params = CreateBugParams( title='bug title', owner=user, information_type=InformationType.PRIVATESECURITY) command = PrivateEmailCommand('private', ['no']) dummy_event = object() params, event = command.execute(bug_params, dummy_event) self.assertEqual(bug_params, params) self.assertEqual(InformationType.PRIVATESECURITY, bug_params.information_type) self.assertEqual(dummy_event, event)