本文整理汇总了Python中taiga.timeline.service.get_project_timeline函数的典型用法代码示例。如果您正苦于以下问题:Python get_project_timeline函数的具体用法?Python get_project_timeline怎么用?Python get_project_timeline使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_project_timeline函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_create_user_story_timeline
def test_create_user_story_timeline():
user_story = factories.UserStoryFactory.create(subject="test us timeline")
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.create"
assert project_timeline[0].data["userstory"]["subject"] == "test us timeline"
assert project_timeline[0].data["user"]["id"] == user_story.owner.id
示例2: test_create_issue_timeline
def test_create_issue_timeline():
issue = factories.IssueFactory.create(subject="test issue timeline")
history_services.take_snapshot(issue, user=issue.owner)
project_timeline = service.get_project_timeline(issue.project)
assert project_timeline[0].event_type == "issues.issue.create"
assert project_timeline[0].data["issue"]["subject"] == "test issue timeline"
assert project_timeline[0].data["user"]["id"] == issue.owner.id
示例3: test_create_task_timeline
def test_create_task_timeline():
task = factories.TaskFactory.create(subject="test task timeline")
history_services.take_snapshot(task, user=task.owner)
project_timeline = service.get_project_timeline(task.project)
assert project_timeline[0].event_type == "tasks.task.create"
assert project_timeline[0].data["task"]["subject"] == "test task timeline"
assert project_timeline[0].data["user"]["id"] == task.owner.id
示例4: test_create_project_timeline
def test_create_project_timeline():
project = factories.ProjectFactory.create(name="test project timeline")
history_services.take_snapshot(project, user=project.owner)
project_timeline = service.get_project_timeline(project)
assert project_timeline[0].event_type == "projects.project.create"
assert project_timeline[0].data["project"]["name"] == "test project timeline"
assert project_timeline[0].data["user"]["id"] == project.owner.id
示例5: test_create_milestone_timeline
def test_create_milestone_timeline():
milestone = factories.MilestoneFactory.create(name="test milestone timeline")
history_services.take_snapshot(milestone, user=milestone.owner)
milestone_timeline = service.get_project_timeline(milestone.project)
assert milestone_timeline[0].event_type == "milestones.milestone.create"
assert milestone_timeline[0].data["milestone"]["name"] == "test milestone timeline"
assert milestone_timeline[0].data["user"]["id"] == milestone.owner.id
示例6: test_create_wiki_page_timeline
def test_create_wiki_page_timeline():
page = factories.WikiPageFactory.create(slug="test wiki page timeline")
history_services.take_snapshot(page, user=page.owner)
project_timeline = service.get_project_timeline(page.project)
assert project_timeline[0].event_type == "wiki.wikipage.create"
assert project_timeline[0].data["wikipage"]["slug"] == "test wiki page timeline"
assert project_timeline[0].data["user"]["id"] == page.owner.id
示例7: test_update_membership_timeline
def test_update_membership_timeline():
user_1 = factories.UserFactory.create()
user_2 = factories.UserFactory.create()
membership = factories.MembershipFactory.create(user=user_1)
membership.user = user_2
membership.save()
project_timeline = service.get_project_timeline(membership.project)
user_1_timeline = service.get_user_timeline(user_1)
user_2_timeline = service.get_user_timeline(user_2)
assert project_timeline[0].event_type == "projects.membership.delete"
assert project_timeline[0].data["project"]["id"] == membership.project.id
assert project_timeline[0].data["user"]["id"] == user_1.id
assert project_timeline[0].data["user"]["name"] == user_1.get_full_name()
assert project_timeline[1].event_type == "projects.membership.create"
assert project_timeline[1].data["project"]["id"] == membership.project.id
assert project_timeline[1].data["user"]["id"] == user_2.id
assert project_timeline[1].data["user"]["name"] == user_2.get_full_name()
assert user_1_timeline[0].event_type == "projects.membership.delete"
assert user_1_timeline[0].data["project"]["id"] == membership.project.id
assert user_1_timeline[0].data["user"]["id"] == user_1.id
assert user_1_timeline[0].data["user"]["name"] == user_1.get_full_name()
assert user_2_timeline[0].event_type == "projects.membership.create"
assert user_2_timeline[0].data["project"]["id"] == membership.project.id
assert user_2_timeline[0].data["user"]["id"] == user_2.id
assert user_2_timeline[0].data["user"]["name"] == user_2.get_full_name()
示例8: test_user_data_for_system_users
def test_user_data_for_system_users():
user_story = factories.UserStoryFactory.create(subject="test us timeline")
user_story.owner.is_system = True
user_story.owner.save()
history_services.take_snapshot(user_story, user=user_story.owner)
project_timeline = service.get_project_timeline(user_story.project)
serialized_obj = TimelineSerializer(project_timeline[0])
serialized_obj.data["data"]["user"]["is_profile_visible"] = False
示例9: test_create_membership_timeline
def test_create_membership_timeline():
membership = factories.MembershipFactory.create()
project_timeline = service.get_project_timeline(membership.project)
user_timeline = service.get_user_timeline(membership.user)
assert project_timeline[0].event_type == "projects.membership.create"
assert project_timeline[0].data["project"]["id"] == membership.project.id
assert project_timeline[0].data["user"]["id"] == membership.user.id
assert user_timeline[0].event_type == "projects.membership.create"
assert user_timeline[0].data["project"]["id"] == membership.project.id
assert user_timeline[0].data["user"]["id"] == membership.user.id
示例10: test_update_milestone_timeline
def test_update_milestone_timeline():
milestone = factories.MilestoneFactory.create(name="test milestone timeline")
history_services.take_snapshot(milestone, user=milestone.owner)
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"
示例11: test_update_wiki_page_timeline
def test_update_wiki_page_timeline():
page = factories.WikiPageFactory.create(slug="test wiki page timeline")
history_services.take_snapshot(page, user=page.owner)
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"
示例12: test_update_task_timeline
def test_update_task_timeline():
task = factories.TaskFactory.create(subject="test task timeline")
history_services.take_snapshot(task, user=task.owner)
task.subject = "test task timeline updated"
task.save()
history_services.take_snapshot(task, user=task.owner)
project_timeline = service.get_project_timeline(task.project)
assert project_timeline[0].event_type == "tasks.task.change"
assert project_timeline[0].data["task"]["subject"] == "test task timeline updated"
assert project_timeline[0].data["values_diff"]["subject"][0] == "test task timeline"
assert project_timeline[0].data["values_diff"]["subject"][1] == "test task timeline updated"
示例13: test_update_issue_timeline
def test_update_issue_timeline():
issue = factories.IssueFactory.create(subject="test issue timeline")
history_services.take_snapshot(issue, user=issue.owner)
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"
示例14: test_update_user_story_timeline
def test_update_user_story_timeline():
user_story = factories.UserStoryFactory.create(subject="test us timeline")
history_services.take_snapshot(user_story, user=user_story.owner)
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"
示例15: 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"