コード例 #1
0
 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)
コード例 #2
0
ファイル: backlog_info_test.py プロジェクト: djangsters/agilo
 def test_gets_read_only_backlog_for_ended_sprint(self):
     # ensure it ends before the weekend so the test doesn't fail on mondays...
     sprint_start = date_to_datetime(today() - timedelta(days=4))
     sprint_end = sprint_start + timedelta(days=1)
     sprint = self.teh.create_sprint(name='fnord', start=sprint_start, end=sprint_end)
     self.assert_smaller_than(sprint.end, date_to_datetime(today()))
     backlog = self.teh.create_backlog(scope=sprint.name, b_type=BacklogType.SPRINT)
     backlog_access = self.access_rights_for_backlog(backlog)
     self.assert_true(backlog_access['is_read_only'])
     self.assert_equals('Cannot modify sprints that have ended.', backlog_access['reason'])
コード例 #3
0
    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)
コード例 #4
0
ファイル: backlog_info_test.py プロジェクト: nagyist/agilo
 def test_gets_read_only_backlog_for_ended_sprint(self):
     # ensure it ends before the weekend so the test doesn't fail on mondays...
     sprint_start = date_to_datetime(today() - timedelta(days=4))
     sprint_end = sprint_start + timedelta(days=1)
     sprint = self.teh.create_sprint(name='fnord',
                                     start=sprint_start,
                                     end=sprint_end)
     self.assert_smaller_than(sprint.end, date_to_datetime(today()))
     backlog = self.teh.create_backlog(scope=sprint.name,
                                       b_type=BacklogType.SPRINT)
     backlog_access = self.access_rights_for_backlog(backlog)
     self.assert_true(backlog_access['is_read_only'])
     self.assert_equals('Cannot modify sprints that have ended.',
                        backlog_access['reason'])
コード例 #5
0
ファイル: new_webui_test.py プロジェクト: djangsters/agilo
 def test_can_return_backlog_info(self):
     sprint_start = date_to_datetime(today() - timedelta(days=4))
     sprint_end = sprint_start + timedelta(days=1)
     sprint = self.teh.create_sprint(name='fnord', start=sprint_start, end=sprint_end)
     backlog = self.teh.create_backlog(scope=sprint.name, b_type=BacklogType.SPRINT)
     info = self.request_backlog(backlog).backlog_info
     self.assert_not_none(info.content['configured_columns'])
コード例 #6
0
 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)
コード例 #7
0
 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)
コード例 #8
0
 def test_can_return_backlog_info(self):
     sprint_start = date_to_datetime(today() - timedelta(days=4))
     sprint_end = sprint_start + timedelta(days=1)
     sprint = self.teh.create_sprint(name='fnord',
                                     start=sprint_start,
                                     end=sprint_end)
     backlog = self.teh.create_backlog(scope=sprint.name,
                                       b_type=BacklogType.SPRINT)
     info = self.request_backlog(backlog).backlog_info
     self.assert_not_none(info.content['configured_columns'])
コード例 #9
0
ファイル: backlog_info_test.py プロジェクト: nagyist/agilo
 def test_not_read_only_if_sprint_not_started(self):
     self.teh.grant_permission(Usernames.team_member, Action.BACKLOG_EDIT)
     sprint = self.teh.create_sprint(name='fnord',
                                     start=date_to_datetime(today() +
                                                            timedelta(3)))
     backlog = self.teh.create_backlog(scope=sprint.name,
                                       b_type=BacklogType.SPRINT)
     backlog_access = self.access_rights_for_backlog(backlog)
     self.assert_false(backlog_access['is_read_only'],
                       backlog_access['reason'])
コード例 #10
0
ファイル: days_time_test.py プロジェクト: nagyist/agilo
 def test_date_to_datetime_conversion_returns_datetimes_unmodified(self):
     some_datetime = now()
     self.assert_equals(some_datetime, date_to_datetime(some_datetime))
コード例 #11
0
ファイル: model.py プロジェクト: nagyist/agilo
 def midnight_in_timezone(timestamp):
     return midnight(
         date_to_datetime(timestamp, self.viewer_timezone).astimezone(
             self.viewer_timezone))
コード例 #12
0
ファイル: model.py プロジェクト: nagyist/agilo
    def _filter_entries_outside_of_interval(self, capacities, start, end):
        start = date_to_datetime(start, self.viewer_timezone)
        end = date_to_datetime(end, self.viewer_timezone)

        is_within_interval = lambda capacity: start <= capacity.when <= end
        return filter(is_within_interval, capacities)
コード例 #13
0
ファイル: model.py プロジェクト: djangsters/agilo
 def _filter_entries_outside_of_interval(self, capacities, start, end):
     start = date_to_datetime(start, self.viewer_timezone)
     end = date_to_datetime(end, self.viewer_timezone)
     
     is_within_interval = lambda capacity: start <= capacity.when <= end
     return filter(is_within_interval, capacities)
コード例 #14
0
ファイル: days_time_test.py プロジェクト: nagyist/agilo
 def test_can_convert_date_to_datetime(self):
     expected_datetime = datetime(2009, 5, 23, 0, 0, tzinfo=localtz)
     some_datetime = date_to_datetime(date(2009, 5, 23))
     self.assert_not_none(some_datetime.tzinfo)
     self.assert_equals(expected_datetime, some_datetime)
コード例 #15
0
ファイル: model.py プロジェクト: djangsters/agilo
 def midnight_in_timezone(timestamp):
     return midnight(date_to_datetime(timestamp, self.viewer_timezone).astimezone(self.viewer_timezone))
コード例 #16
0
ファイル: backlog_info_test.py プロジェクト: djangsters/agilo
 def test_not_read_only_if_sprint_not_started(self):
     self.teh.grant_permission(Usernames.team_member, Action.BACKLOG_EDIT)
     sprint = self.teh.create_sprint(name='fnord', start=date_to_datetime(today() + timedelta(3)))
     backlog = self.teh.create_backlog(scope=sprint.name, b_type=BacklogType.SPRINT)
     backlog_access = self.access_rights_for_backlog(backlog)
     self.assert_false(backlog_access['is_read_only'], backlog_access['reason'])
コード例 #17
0
 def __init__(self, when):
     self.when = date_to_datetime(when)
コード例 #18
0
 def __init__(self, when):
     value = self._tick_label(when)
     when = date_to_datetime(when)
     self.super(value, when)
コード例 #19
0
ファイル: days_time_test.py プロジェクト: djangsters/agilo
 def test_can_convert_date_to_datetime(self):
     expected_datetime = datetime(2009, 5, 23, 0, 0, tzinfo=localtz)
     some_datetime = date_to_datetime(date(2009, 5, 23))
     self.assert_not_none(some_datetime.tzinfo)
     self.assert_equals(expected_datetime, some_datetime)
コード例 #20
0
ファイル: days_time_test.py プロジェクト: djangsters/agilo
 def test_date_to_datetime_conversion_returns_datetimes_unmodified(self):
     some_datetime = now()
     self.assert_equals(some_datetime, date_to_datetime(some_datetime))