test_commands.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:adhocracy4 作者: liqd 项目源码 文件源码
def test_project_starts_later_or_earlier(phase_factory):

    phase = phase_factory(
        start_date=parse('2013-01-01 17:00:00 UTC'),
        end_date=parse('2013-01-02 18:00:00 UTC')
    )

    with freeze_time(phase.start_date - timedelta(days=1)):
        call_command('create_system_actions')
        action_count = Action.objects.filter(verb=START).count()
        assert action_count == 0

    with freeze_time(phase.start_date + timedelta(days=1)):
        call_command('create_system_actions')
        action_count = Action.objects.filter(verb=START).count()
        assert action_count == 0
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号