当前位置: 首页>>代码示例>>Python>>正文


Python service.get_profile_timeline函数代码示例

本文整理汇总了Python中taiga.timeline.service.get_profile_timeline函数的典型用法代码示例。如果您正苦于以下问题:Python get_profile_timeline函数的具体用法?Python get_profile_timeline怎么用?Python get_profile_timeline使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_profile_timeline函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_assigned_to_user_story_timeline

def test_assigned_to_user_story_timeline():
    membership = factories.MembershipFactory.create()
    user_story = factories.UserStoryFactory.create(subject="test us timeline", assigned_to=membership.user, project=membership.project)
    history_services.take_snapshot(user_story, user=user_story.owner)
    user_timeline = service.get_profile_timeline(user_story.assigned_to)
    assert user_timeline[0].event_type == "userstories.userstory.create"
    assert user_timeline[0].data["userstory"]["subject"] == "test us timeline"
开发者ID:cubettech,项目名称:taiga-back,代码行数:7,代码来源:test_timeline.py

示例2: test_watchers_to_user_story_timeline

def test_watchers_to_user_story_timeline():
    membership = factories.MembershipFactory.create()
    user_story = factories.UserStoryFactory.create(subject="test us timeline")
    user_story.watchers.add(membership.user)
    history_services.take_snapshot(user_story, user=user_story.owner)
    user_timeline = service.get_profile_timeline(membership.user)
    assert user_timeline[0].event_type == "userstories.userstory.create"
    assert user_timeline[0].data["userstory"]["subject"] == "test us timeline"
开发者ID:mornhuang,项目名称:taiga-back,代码行数:8,代码来源:test_timeline.py

示例3: test_timeline_error_use_member_ids_instead_of_memberships_ids

def test_timeline_error_use_member_ids_instead_of_memberships_ids():
    user_story = factories.UserStoryFactory.create(subject="test error use member ids instead of " "memberships ids")

    member_user = user_story.owner
    external_user = factories.UserFactory.create()

    membership = factories.MembershipFactory.create(project=user_story.project, user=member_user, id=external_user.id)

    history_services.take_snapshot(user_story, user=member_user)

    user_timeline = service.get_profile_timeline(member_user)
    assert len(user_timeline) == 2
    assert user_timeline[0].event_type == "userstories.userstory.create"
    assert user_timeline[1].event_type == "users.user.create"

    external_user_timeline = service.get_profile_timeline(external_user)
    assert len(external_user_timeline) == 1
    assert external_user_timeline[0].event_type == "users.user.create"
开发者ID:niibruce,项目名称:taiga-back,代码行数:18,代码来源:test_timeline.py

示例4: test_delete_task_timeline

def test_delete_task_timeline():
    task = factories.TaskFactory.create(subject="test task timeline")
    user_watcher= factories.UserFactory()
    task.add_watcher(user_watcher)
    history_services.take_snapshot(task, user=task.owner, delete=True)
    project_timeline = service.get_project_timeline(task.project)
    assert project_timeline[0].event_type == "tasks.task.delete"
    assert project_timeline[0].data["task"]["subject"] == "test task timeline"
    user_watcher_timeline = service.get_profile_timeline(user_watcher)
    assert user_watcher_timeline[0].event_type == "tasks.task.delete"
    assert user_watcher_timeline[0].data["task"]["subject"] == "test task timeline"
开发者ID:cubettech,项目名称:taiga-back,代码行数:11,代码来源:test_timeline.py

示例5: test_delete_issue_timeline

def test_delete_issue_timeline():
    issue = factories.IssueFactory.create(subject="test issue timeline")
    user_watcher= factories.UserFactory()
    issue.add_watcher(user_watcher)
    history_services.take_snapshot(issue, user=issue.owner, delete=True)
    project_timeline = service.get_project_timeline(issue.project)
    assert project_timeline[0].event_type == "issues.issue.delete"
    assert project_timeline[0].data["issue"]["subject"] == "test issue timeline"
    user_watcher_timeline = service.get_profile_timeline(user_watcher)
    assert user_watcher_timeline[0].event_type == "issues.issue.delete"
    assert user_watcher_timeline[0].data["issue"]["subject"] == "test issue timeline"
开发者ID:cubettech,项目名称:taiga-back,代码行数:11,代码来源:test_timeline.py

示例6: test_delete_user_story_timeline

def test_delete_user_story_timeline():
    user_story = factories.UserStoryFactory.create(subject="test us timeline")
    user_watcher= factories.UserFactory()
    user_story.add_watcher(user_watcher)
    history_services.take_snapshot(user_story, user=user_story.owner, delete=True)
    project_timeline = service.get_project_timeline(user_story.project)
    assert project_timeline[0].event_type == "userstories.userstory.delete"
    assert project_timeline[0].data["userstory"]["subject"] == "test us timeline"
    user_watcher_timeline = service.get_profile_timeline(user_watcher)
    assert user_watcher_timeline[0].event_type == "userstories.userstory.delete"
    assert user_watcher_timeline[0].data["userstory"]["subject"] == "test us timeline"
开发者ID:cubettech,项目名称:taiga-back,代码行数:11,代码来源:test_timeline.py

示例7: test_delete_milestone_timeline

def test_delete_milestone_timeline():
    milestone = factories.MilestoneFactory.create(name="test milestone timeline")
    user_watcher= factories.UserFactory()
    milestone.add_watcher(user_watcher)
    history_services.take_snapshot(milestone, user=milestone.owner, delete=True)
    project_timeline = service.get_project_timeline(milestone.project)
    assert project_timeline[0].event_type == "milestones.milestone.delete"
    assert project_timeline[0].data["milestone"]["name"] == "test milestone timeline"
    user_watcher_timeline = service.get_profile_timeline(user_watcher)
    assert user_watcher_timeline[0].event_type == "milestones.milestone.delete"
    assert user_watcher_timeline[0].data["milestone"]["name"] == "test milestone timeline"
开发者ID:cubettech,项目名称:taiga-back,代码行数:11,代码来源:test_timeline.py

示例8: test_delete_project_timeline

def test_delete_project_timeline():
    project = factories.ProjectFactory.create(name="test project timeline")
    user_watcher= factories.UserFactory()
    project.add_watcher(user_watcher)
    history_services.take_snapshot(project, user=project.owner, delete=True)
    user_timeline = service.get_project_timeline(project)
    assert user_timeline[0].event_type == "projects.project.delete"
    assert user_timeline[0].data["project"]["id"] == project.id
    user_watcher_timeline = service.get_profile_timeline(user_watcher)
    assert user_watcher_timeline[0].event_type == "projects.project.delete"
    assert user_watcher_timeline[0].data["project"]["id"] == project.id
开发者ID:cubettech,项目名称:taiga-back,代码行数:11,代码来源:test_timeline.py

示例9: test_delete_wiki_page_timeline

def test_delete_wiki_page_timeline():
    page = factories.WikiPageFactory.create(slug="test wiki page timeline")
    user_watcher= factories.UserFactory()
    page.add_watcher(user_watcher)
    history_services.take_snapshot(page, user=page.owner, delete=True)
    project_timeline = service.get_project_timeline(page.project)
    assert project_timeline[0].event_type == "wiki.wikipage.delete"
    assert project_timeline[0].data["wikipage"]["slug"] == "test wiki page timeline"
    user_watcher_timeline = service.get_profile_timeline(user_watcher)
    assert user_watcher_timeline[0].event_type == "wiki.wikipage.delete"
    assert user_watcher_timeline[0].data["wikipage"]["slug"] == "test wiki page timeline"
开发者ID:cubettech,项目名称:taiga-back,代码行数:11,代码来源:test_timeline.py

示例10: test_assigned_users_user_story_timeline

def test_assigned_users_user_story_timeline():
    membership = factories.MembershipFactory.create()
    user_story = factories.UserStoryFactory.create(subject="test us timeline",
                                                   project=membership.project)
    history_services.take_snapshot(user_story, user=user_story.owner)
    user_timeline = service.get_profile_timeline(user_story.owner)

    assert user_timeline[0].event_type == "userstories.userstory.create"
    assert user_timeline[0].data["userstory"]["subject"] == "test us timeline"

    user_story.assigned_to = membership.user
    user_story.assigned_users = (membership.user,)
    user_story.save()

    history_services.take_snapshot(user_story, user=user_story.owner)

    user_timeline = service.get_profile_timeline(user_story.owner)

    assert user_timeline[0].event_type == "userstories.userstory.change"
    assert "assigned_to" not in user_timeline[0].data["values_diff"].keys()
    assert user_timeline[0].data["values_diff"]['assigned_users'] == \
        [None, membership.user.username]
开发者ID:taigaio,项目名称:taiga-back,代码行数:22,代码来源:test_timeline.py

示例11: test_update_wiki_page_timeline

def test_update_wiki_page_timeline():
    user_watcher= factories.UserFactory()
    page = factories.WikiPageFactory.create(slug="test wiki page timeline")
    history_services.take_snapshot(page, user=page.owner)
    page.add_watcher(user_watcher)
    page.slug = "test wiki page timeline updated"
    page.save()
    history_services.take_snapshot(page, user=page.owner)
    project_timeline = service.get_project_timeline(page.project)
    assert project_timeline[0].event_type == "wiki.wikipage.change"
    assert project_timeline[0].data["wikipage"]["slug"] == "test wiki page timeline updated"
    assert project_timeline[0].data["values_diff"]["slug"][0] == "test wiki page timeline"
    assert project_timeline[0].data["values_diff"]["slug"][1] == "test wiki page timeline updated"
    user_watcher_timeline = service.get_profile_timeline(user_watcher)
    assert user_watcher_timeline[0].event_type == "wiki.wikipage.change"
    assert user_watcher_timeline[0].data["wikipage"]["slug"] == "test wiki page timeline updated"
    assert user_watcher_timeline[0].data["values_diff"]["slug"][0] == "test wiki page timeline"
    assert user_watcher_timeline[0].data["values_diff"]["slug"][1] == "test wiki page timeline updated"
开发者ID:cubettech,项目名称:taiga-back,代码行数:18,代码来源:test_timeline.py

示例12: test_update_issue_timeline

def test_update_issue_timeline():
    user_watcher= factories.UserFactory()
    issue = factories.IssueFactory.create(subject="test issue timeline")
    history_services.take_snapshot(issue, user=issue.owner)
    issue.add_watcher(user_watcher)
    issue.subject = "test issue timeline updated"
    issue.save()
    history_services.take_snapshot(issue, user=issue.owner)
    project_timeline = service.get_project_timeline(issue.project)
    assert project_timeline[0].event_type == "issues.issue.change"
    assert project_timeline[0].data["issue"]["subject"] == "test issue timeline updated"
    assert project_timeline[0].data["values_diff"]["subject"][0] == "test issue timeline"
    assert project_timeline[0].data["values_diff"]["subject"][1] == "test issue timeline updated"
    user_watcher_timeline = service.get_profile_timeline(user_watcher)
    assert user_watcher_timeline[0].event_type == "issues.issue.change"
    assert user_watcher_timeline[0].data["issue"]["subject"] == "test issue timeline updated"
    assert user_watcher_timeline[0].data["values_diff"]["subject"][0] == "test issue timeline"
    assert user_watcher_timeline[0].data["values_diff"]["subject"][1] == "test issue timeline updated"
开发者ID:cubettech,项目名称:taiga-back,代码行数:18,代码来源:test_timeline.py

示例13: test_update_user_story_timeline

def test_update_user_story_timeline():
    user_watcher= factories.UserFactory()
    user_story = factories.UserStoryFactory.create(subject="test us timeline")
    history_services.take_snapshot(user_story, user=user_story.owner)
    user_story.add_watcher(user_watcher)
    user_story.subject = "test us timeline updated"
    user_story.save()
    history_services.take_snapshot(user_story, user=user_story.owner)
    project_timeline = service.get_project_timeline(user_story.project)
    assert project_timeline[0].event_type == "userstories.userstory.change"
    assert project_timeline[0].data["userstory"]["subject"] == "test us timeline updated"
    assert project_timeline[0].data["values_diff"]["subject"][0] == "test us timeline"
    assert project_timeline[0].data["values_diff"]["subject"][1] == "test us timeline updated"
    user_watcher_timeline = service.get_profile_timeline(user_watcher)
    assert user_watcher_timeline[0].event_type == "userstories.userstory.change"
    assert user_watcher_timeline[0].data["userstory"]["subject"] == "test us timeline updated"
    assert user_watcher_timeline[0].data["values_diff"]["subject"][0] == "test us timeline"
    assert user_watcher_timeline[0].data["values_diff"]["subject"][1] == "test us timeline updated"
开发者ID:cubettech,项目名称:taiga-back,代码行数:18,代码来源:test_timeline.py

示例14: test_update_milestone_timeline

def test_update_milestone_timeline():
    user_watcher= factories.UserFactory()
    milestone = factories.MilestoneFactory.create(name="test milestone timeline")
    history_services.take_snapshot(milestone, user=milestone.owner)
    milestone.add_watcher(user_watcher)
    milestone.name = "test milestone timeline updated"
    milestone.save()
    history_services.take_snapshot(milestone, user=milestone.owner)
    project_timeline = service.get_project_timeline(milestone.project)
    assert project_timeline[0].event_type == "milestones.milestone.change"
    assert project_timeline[0].data["milestone"]["name"] == "test milestone timeline updated"
    assert project_timeline[0].data["values_diff"]["name"][0] == "test milestone timeline"
    assert project_timeline[0].data["values_diff"]["name"][1] == "test milestone timeline updated"
    user_watcher_timeline = service.get_profile_timeline(user_watcher)
    assert user_watcher_timeline[0].event_type == "milestones.milestone.change"
    assert user_watcher_timeline[0].data["milestone"]["name"] == "test milestone timeline updated"
    assert user_watcher_timeline[0].data["values_diff"]["name"][0] == "test milestone timeline"
    assert user_watcher_timeline[0].data["values_diff"]["name"][1] == "test milestone timeline updated"
开发者ID:cubettech,项目名称:taiga-back,代码行数:18,代码来源:test_timeline.py

示例15: test_update_project_timeline

def test_update_project_timeline():
    user_watcher= factories.UserFactory()
    project = factories.ProjectFactory.create(name="test project timeline")
    history_services.take_snapshot(project, user=project.owner)
    project.add_watcher(user_watcher)
    project.name = "test project timeline updated"
    project.save()
    history_services.take_snapshot(project, user=project.owner)
    project_timeline = service.get_project_timeline(project)
    assert project_timeline[0].event_type == "projects.project.change"
    assert project_timeline[0].data["project"]["name"] == "test project timeline updated"
    assert project_timeline[0].data["values_diff"]["name"][0] == "test project timeline"
    assert project_timeline[0].data["values_diff"]["name"][1] == "test project timeline updated"
    user_watcher_timeline = service.get_profile_timeline(user_watcher)
    assert user_watcher_timeline[0].event_type == "projects.project.change"
    assert user_watcher_timeline[0].data["project"]["name"] == "test project timeline updated"
    assert user_watcher_timeline[0].data["values_diff"]["name"][0] == "test project timeline"
    assert user_watcher_timeline[0].data["values_diff"]["name"][1] == "test project timeline updated"
开发者ID:cubettech,项目名称:taiga-back,代码行数:18,代码来源:test_timeline.py


注:本文中的taiga.timeline.service.get_profile_timeline函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。