From cc4f64c115bc447419e9f85ce4cb2af2768f11a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Tue, 11 Nov 2014 13:51:25 +0100 Subject: [PATCH] Fixed travis errors --- taiga/github_hook/event_hooks.py | 2 +- tests/integration/test_github_hook.py | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/taiga/github_hook/event_hooks.py b/taiga/github_hook/event_hooks.py index b2ba7961..3931c679 100644 --- a/taiga/github_hook/event_hooks.py +++ b/taiga/github_hook/event_hooks.py @@ -151,5 +151,5 @@ class IssueCommentEventHook(BaseEventHook): uss = UserStory.objects.filter(external_reference=["github", github_reference]) for item in list(issues) + list(tasks) + list(uss): - snapshot = take_snapshot(item, comment="From Github:\n\n {}".format(comment_message), user=get_github_user(github_user)) + snapshot = take_snapshot(item, comment="From Github:\n\n{}".format(comment_message), user=get_github_user(github_user)) send_notifications(item, history=snapshot) diff --git a/tests/integration/test_github_hook.py b/tests/integration/test_github_hook.py index d5504a5a..a5742522 100644 --- a/tests/integration/test_github_hook.py +++ b/tests/integration/test_github_hook.py @@ -223,6 +223,9 @@ def test_issues_event_opened_issue(client): }, "assignee": {}, "label": {}, + "repository": { + "html_url": "test", + }, } mail.outbox = [] @@ -303,6 +306,9 @@ def test_issue_comment_event_on_existing_issue_task_and_us(client): "comment": { "body": "Test body", }, + "repository": { + "html_url": "test", + }, } mail.outbox = [] @@ -316,15 +322,15 @@ def test_issue_comment_event_on_existing_issue_task_and_us(client): issue_history = get_history_queryset_by_model_instance(issue) assert issue_history.count() == 1 - assert issue_history[0].comment == "From Github: Test body" + assert issue_history[0].comment == "From Github:\n\nTest body" task_history = get_history_queryset_by_model_instance(task) assert task_history.count() == 1 - assert task_history[0].comment == "From Github: Test body" + assert task_history[0].comment == "From Github:\n\nTest body" us_history = get_history_queryset_by_model_instance(us) assert us_history.count() == 1 - assert us_history[0].comment == "From Github: Test body" + assert us_history[0].comment == "From Github:\n\nTest body" assert len(mail.outbox) == 3 @@ -345,6 +351,9 @@ def test_issue_comment_event_on_not_existing_issue_task_and_us(client): "comment": { "body": "Test body", }, + "repository": { + "html_url": "test", + }, } mail.outbox = [] @@ -371,6 +380,9 @@ def test_issues_event_bad_comment(client): "action": "other", "issue": {}, "comment": {}, + "repository": { + "html_url": "test", + }, } ev_hook = event_hooks.IssueCommentEventHook(issue.project, payload)