def test_stats_users_with_period(self):
"""Test CACHE PROJECT STATS user stats with period works."""
pr = ProjectFactory.create()
d = date.today() - timedelta(days=6)
TaskRunFactory.create(project=pr, created=d, finish_time=d)
d = date.today() - timedelta(days=16)
AnonymousTaskRunFactory.create(project=pr, created=d, finish_time=d)
users, anon_users, auth_users = stats_users(pr.id, '1 week')
assert len(users) == 2, len(users)
assert len(anon_users) == 0, len(anon_users)
assert len(auth_users) == 1, len(auth_users)
test_cache_project_stats.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录