def test_can_move_indirect_task(self): bug = self.teh.create_ticket(t_type=Type.BUG, props=dict(sprint=self.old_sprint)) self.assert_true(bug.link_to(self.story)) mover = TicketHierarchyMover(self.env, bug, self.old_sprint, self.new_sprint) mover.execute() self._assert_ticket_has_new_sprint(self.task.id)
def test_does_not_move_closed_task(self): self.task[Key.STATUS] = Status.CLOSED self.task.save_changes(None, None) mover = TicketHierarchyMover(self.env, self.story, self.old_sprint, self.new_sprint) mover.execute() self._assert_ticket_has_old_sprint(self.task.id)
def test_will_store_custom_author_on_changelog(self): mover = TicketHierarchyMover(self.env, self.story, self.old_sprint, self.new_sprint, changelog_author="fnord") mover.execute() self.assert_equals("fnord", self.teh.last_changelog_author(self.task))
def test_does_not_move_task_with_different_sprint(self): self.teh.create_sprint('Third Sprint') self.task[Key.SPRINT] = 'Third Sprint' self.task.save_changes(None, None) mover = TicketHierarchyMover(self.env, self.story, self.old_sprint, self.new_sprint) mover.execute() self._assert_ticket_has_sprint(self.task.id, 'Third Sprint')
def test_does_not_explode_if_child_has_no_sprint_field(self): self.teh.allow_link_from_to(Type.USER_STORY, Type.REQUIREMENT) # recreate object because the allowed links are cached inside self.story = AgiloTicket(self.env, self.story.id) requirement = self.teh.create_ticket(t_type=Type.REQUIREMENT) self.assert_true(self.story.link_to(requirement)) mover = TicketHierarchyMover(self.env, self.story, self.old_sprint, self.new_sprint) mover.execute() self._assert_ticket_has_sprint(requirement.id, '')
def _assert_move_task_of_story(self): mover = TicketHierarchyMover(self.env, self.story, self.old_sprint, self.new_sprint) self._assert_ticket_has_old_sprint(self.task.id) mover.execute() self._assert_ticket_has_new_sprint(self.task.id)
def _move_children(self, ticket, source_sprint_name, target_sprint_name, author): mover = TicketHierarchyMover(self.env, ticket, source_sprint_name, target_sprint_name, author) mover.execute()