def testCanNotOverwriteExistingSprintByRename(self):
     self.assert_not_equals(tomorrow(utc), self.sprint.start)
     existing_name = 'existing'
     self.teh.create_sprint(existing_name, start=date_to_datetime(tomorrow(utc)))
     
     one_day_before = date_to_datetime(yesterday(), tz=utc)
     
     parameters = dict(old_sprint=self.sprint.name, sprint=existing_name, start=one_day_before)
     self.assert_raises(ICommand.NotValidError, self._save_sprint, **parameters)
    def testCanNotOverwriteExistingSprintByRename(self):
        self.assert_not_equals(tomorrow(utc), self.sprint.start)
        existing_name = 'existing'
        self.teh.create_sprint(existing_name,
                               start=date_to_datetime(tomorrow(utc)))

        one_day_before = date_to_datetime(yesterday(), tz=utc)

        parameters = dict(old_sprint=self.sprint.name,
                          sprint=existing_name,
                          start=one_day_before)
        self.assert_raises(ICommand.NotValidError, self._save_sprint,
                           **parameters)
 def testCanEditDataOfExistingSprint(self):
     # Disable normalization of dates, so that works also on Friday
     self.teh.disable_sprint_date_normalization()
     new_sprint_end = date_to_datetime(tomorrow(), tz=utc)
     self._save_sprint(old_sprint=self.sprint.name, sprint=self.sprint.name, 
                       end=new_sprint_end)
     sprint = self._get_sprint(self.sprint.name)
     self.assert_equals(new_sprint_end, sprint.end)
 def testCanEditDataOfExistingSprint(self):
     # Disable normalization of dates, so that works also on Friday
     self.teh.disable_sprint_date_normalization()
     new_sprint_end = date_to_datetime(tomorrow(), tz=utc)
     self._save_sprint(old_sprint=self.sprint.name,
                       sprint=self.sprint.name,
                       end=new_sprint_end)
     sprint = self._get_sprint(self.sprint.name)
     self.assert_equals(new_sprint_end, sprint.end)
Beispiel #5
0
 def test_can_sum_remaining_capacities_in_sprint(self):
     self.teh.disable_sprint_date_normalization()
     team, member = self.team_with_one_member()
     self._set_default_capacity_for_member(9*2, member)
     
     sprint =  self.teh.create_sprint(name="SprintWithContingent", team=team,
                                      start=midnight(yesterday()), 
                                      end=midnight(tomorrow()))
     summed = team.capacity().summed_hourly_capacities_in_sprint(sprint)
     # 2*9 (no. working hours), +8 (additional hours after zero), +1 (00:00-01:00 on the last day)
     self.assert_length(9*2+8+1, summed)
     self.assert_equals(2*(9*2), summed[0].capacity)
     self.assert_equals(0, summed[-1].capacity)
Beispiel #6
0
 def test_cuts_off_times_that_would_be_on_previous_day_for_the_viewer(self):
     team, member1 = self.team_with_one_member()
     set_user_attribute_in_session(self.env, 'tz', 'GMT +11:00', member1.name)
     
     viewer_timezone = utc
     # don't want to get values from tomorrow
     self.set_hours_for_day_on_team_member(0, tomorrow(viewer_timezone), member1)
     # 11:00 at his place is 0:00 here, so two values should be lost
     
     capacities = team.capacity(viewer_timezone).hourly_capacities_for_day(today())
     self.assert_length(8, capacities)
     self.assert_equals(1, capacities[0].capacity)
     self.assert_equals(1, capacities[-2].capacity)
     start_of_day_for_member1 = midnight(now(tz=viewer_timezone))
     self.assert_equals(start_of_day_for_member1, capacities[0].when)
Beispiel #7
0
 def test_capacity_can_take_timezone_parameter(self):
     team, member = self.team_with_one_member()
     self._set_default_capacity_for_member(0, member)
     set_user_attribute_in_session(self.env, 'tz', 'GMT', member.name)
     self.set_hours_for_day_on_team_member(9, today(member.timezone()), member)
     
     viewer_timezone = get_timezone('GMT -12:00')
     capacitator = team.capacity(viewer_timezone)
     # Need to take the member timezone for start and end, to make sure that we really cut off all
     # workhours he has on the previous day - even though they would be on the current day when
     # viewed from the viewers timezone.
     hourly_capacities = capacitator.hourly_capacities_in_interval(today(tz=member.timezone()), tomorrow(tz=member.timezone()))
     self.assert_length(7, hourly_capacities)
Beispiel #8
0
 def test_can_return_capacity_series_for_interval(self):
     team, member1 = self.team_with_one_member()
     self._set_default_capacity_for_member(1, member1)
     # tomorrow -> date -> 0:00 on date -> removes everything on that day
     self.assert_length(2*9 + 2, team.capacity().hourly_capacities_in_interval(yesterday(), tomorrow()))