def test_project_start_reschedule(phase_factory):
phase = phase_factory(
start_date=parse('2013-01-01 17:00:00 UTC'),
end_date=parse('2013-01-01 18:00:00 UTC')
)
# first phase starts within an hour
with freeze_time(phase.start_date + timedelta(minutes=30)):
call_command('create_system_actions')
action_count = Action.objects.filter(verb=START).count()
assert action_count == 1
# first phases start date has been moved forward
# and the start actions timestamp has to be adapted
phase.start_date = phase.start_date + timedelta(days=1)
phase.save()
with freeze_time(phase.start_date + timedelta(minutes=30)):
call_command('create_system_actions')
action_count = Action.objects.filter(verb=START).count()
assert action_count == 1
action = Action.objects.filter(verb=START).first()
assert action.timestamp == phase.start_date
评论列表
文章目录