def _get_sprint(self, sprint_name): from agilo.scrum.sprint.model import Sprint, SprintModelManager if isinstance(sprint_name, Sprint): return sprint_name sprint_name = self.super.validate(self._sprint_name(sprint_name)) sprint = SprintModelManager(self.env).get(name=sprint_name) return sprint
def _currently_running_sprint(self): running_sprints = [] for sprint in SprintModelManager(self.env).select(): if not sprint.is_currently_running: continue running_sprints.append(sprint) if len(running_sprints) == 0: return None return running_sprints[-1]
def sprint(self): """Return a sprint object from the session, if that fails, reset the sprint scope in the session and return None.""" assert self.env is not None # AT: It is not stated that the current name of sprint set in # the session is still there or valid, we need to check it sprint = SprintModelManager(self.env).get(name=self.sprint_name()) if sprint is None: self.reset_sprint_scope() return sprint
def test_stores_team_capacity_in_metrics(self): # Sprint must start at the same time (or before) the team members # start working or not all of his capacity will be in the sprint self.sprint.start = self.sprint.start.replace( hour=9, minute=0, second=0, microsecond=0, tzinfo=self.team.members[0].timezone()) self.sprint.save() SprintModelManager(self.env).get_cache().invalidate() self.assert_none(self._capacity(self.sprint, self.team)) self._confirm_commitment() self.assert_almost_equals(10 * 6, self._capacity(self.sprint, self.team), max_delta=0.01)
def testMilestoneRenamePropagatesToSprints(self): """Tests that the rename of a Milestone, propagates to the Sprints, this is an AgiloMilestone feature""" m = Milestone(self.env) m.name = 'test_me' m.insert() s = self.teh.create_sprint('my sprint', milestone=m.name) self.assert_equals(m.name, s.milestone) # AT: we need to reload the milestone as there is a problem in trac, # that the insert is not updating the _old_name, making the update # silently fail. I sent a patch for this m = Milestone(self.env, m.name) m.name = 'test_me_not' m.update() smm = SprintModelManager(self.env) smm.get_cache().invalidate() s = smm.get(name=s.name) self.assert_equals(m.name, s.milestone)
def __init__(self): # Create an instance of Sprint Manager self.sm = SprintModelManager(self.env) self.tm = TeamModelManager(self.env)
def setUp(self): self.super() self.teh.disable_sprint_date_normalization() self._create_sprint_with_team_and_small_backlog() self.teh.grant_permission(self.username(), Action.CONFIRM_COMMITMENT) self.smm = SprintModelManager(self.env)
def __init__(self): """Initialize the component, sets some references to needed Model Managers""" self.sp_manager = SprintModelManager(self.env) self.tm_manager = TeamModelManager(self.env)