Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
webhook/jira: Rename fixture files.
Niloth P7218d846757c
diff --git a/zerver/lib/integrations.py b/zerver/lib/integrations.pyindex 157964b4640..2849889078e 100644--- a/zerver/lib/integrations.py+++ b/zerver/lib/integrations.py@@ -752,7 +752,7 @@ INCOMING_WEBHOOK_INTEGRATIONS: list[IncomingWebhookIntegration] = [IncomingWebhookIntegration("jira",["project-management"],- [WebhookScreenshotConfig("created_assignee_v2.json")],+ [WebhookScreenshotConfig("issue_created_with_assignee.json")],),IncomingWebhookIntegration("jotform", ["productivity"], [WebhookScreenshotConfig("screenshot_response.multipart")]diff --git a/zerver/tests/test_decorators.py b/zerver/tests/test_decorators.pyindex 937ad455e0f..4a7a0059663 100644--- a/zerver/tests/test_decorators.py+++ b/zerver/tests/test_decorators.py@@ -677,7 +677,7 @@ class DeactivatedRealmTest(ZulipTestCase):user_profile = self.example_user("hamlet")api_key = user_profile.api_keyurl = f"/api/v1/external/jira?api_key={api_key}&stream=jira_custom"- data = self.webhook_fixture_data("jira", "created_v2")+ data = self.webhook_fixture_data("jira", "issue_created")result = self.client_post(url, data, content_type="application/json")self.assert_json_error_contains(result, "This organization has been deactivated", status_code=401@@ -879,7 +879,7 @@ class InactiveUserTest(ZulipTestCase):api_key = user_profile.api_keyurl = f"/api/v1/external/jira?api_key={api_key}&stream=jira_custom"- data = self.webhook_fixture_data("jira", "created_v2")+ data = self.webhook_fixture_data("jira", "issue_created")result = self.client_post(url, data, content_type="application/json")self.assert_json_error_contains(result, "Account is deactivated", status_code=401)diff --git a/zerver/webhooks/jira/fixtures/created_v2.json b/zerver/webhooks/jira/fixtures/issue_created.jsonsimilarity index 100%rename from zerver/webhooks/jira/fixtures/created_v2.jsonrename to zerver/webhooks/jira/fixtures/issue_created.jsondiff --git a/zerver/webhooks/jira/fixtures/created_assignee_v2.json b/zerver/webhooks/jira/fixtures/issue_created_with_assignee.jsonsimilarity index 100%rename from zerver/webhooks/jira/fixtures/created_assignee_v2.jsonrename to zerver/webhooks/jira/fixtures/issue_created_with_assignee.jsondiff --git a/zerver/webhooks/jira/fixtures/created_with_unicode_v2.json b/zerver/webhooks/jira/fixtures/issue_created_with_unicode.jsonsimilarity index 100%rename from zerver/webhooks/jira/fixtures/created_with_unicode_v2.jsonrename to zerver/webhooks/jira/fixtures/issue_created_with_unicode.jsondiff --git a/zerver/webhooks/jira/fixtures/deleted_v2.json b/zerver/webhooks/jira/fixtures/issue_deleted.jsonsimilarity index 100%rename from zerver/webhooks/jira/fixtures/deleted_v2.jsonrename to zerver/webhooks/jira/fixtures/issue_deleted.jsondiff --git a/zerver/webhooks/jira/fixtures/unknown_v2.json b/zerver/webhooks/jira/fixtures/issue_unknown.jsonsimilarity index 100%rename from zerver/webhooks/jira/fixtures/unknown_v2.jsonrename to zerver/webhooks/jira/fixtures/issue_unknown.jsondiff --git a/zerver/webhooks/jira/fixtures/updated_priority_v2.json b/zerver/webhooks/jira/fixtures/issue_updated__priority.jsonsimilarity index 100%rename from zerver/webhooks/jira/fixtures/updated_priority_v2.jsonrename to zerver/webhooks/jira/fixtures/issue_updated__priority.jsondiff --git a/zerver/webhooks/jira/fixtures/reassigned_v2.json b/zerver/webhooks/jira/fixtures/issue_updated__reassigned.jsonsimilarity index 100%rename from zerver/webhooks/jira/fixtures/reassigned_v2.jsonrename to zerver/webhooks/jira/fixtures/issue_updated__reassigned.jsondiff --git a/zerver/webhooks/jira/fixtures/change_status_v2.json b/zerver/webhooks/jira/fixtures/issue_updated__status.jsonsimilarity index 100%rename from zerver/webhooks/jira/fixtures/change_status_v2.jsonrename to zerver/webhooks/jira/fixtures/issue_updated__status.jsondiff --git a/zerver/webhooks/jira/tests.py b/zerver/webhooks/jira/tests.pyindex 069faac88dd..25eaf4ec6bf 100644--- a/zerver/webhooks/jira/tests.py+++ b/zerver/webhooks/jira/tests.py@@ -11,7 +11,7 @@ class JiraHookTests(WebhookTestCase):msg = self.send_webhook_payload(self.test_user,url,- self.get_body("created_v2"),+ self.get_body("issue_created"),content_type="application/json",)expected_content = """@@ -35,7 +35,7 @@ Leo Franchi created [BUG-15: New bug with hook](http://lfranchi.com:8080/browse/* **Priority**: Major* **Assignee**: no one""".strip()- self.check_webhook("created_v2", expected_topic_name, expected_message)+ self.check_webhook("issue_created", expected_topic_name, expected_message)def test_ignored_events(self) -> None:ignored_actions = [@@ -65,7 +65,7 @@ Leo Franchià created [BUG-15: New bug with à hook](http://lfranchi.com:8080/br* **Priority**: Major* **Assignee**: no one""".strip()- self.check_webhook("created_with_unicode_v2", expected_topic_name, expected_message)+ self.check_webhook("issue_created_with_unicode", expected_topic_name, expected_message)def test_created_assignee(self) -> None:expected_topic_name = "TEST-4: Test Created Assignee"@@ -75,33 +75,33 @@ Leonardo Franchi [Administrator] created [TEST-4: Test Created Assignee](https:/* **Priority**: Major* **Assignee**: Leonardo Franchi [Administrator]""".strip()- self.check_webhook("created_assignee_v2", expected_topic_name, expected_message)+ self.check_webhook("issue_created_with_assignee", expected_topic_name, expected_message)def test_deleted(self) -> None:expected_topic_name = "BUG-15: New bug with hook"expected_message = "Leo Franchi deleted [BUG-15: New bug with hook](http://lfranchi.com:8080/browse/BUG-15)."- self.check_webhook("deleted_v2", expected_topic_name, expected_message)+ self.check_webhook("issue_deleted", expected_topic_name, expected_message)def test_reassigned(self) -> None:expected_topic_name = "BUG-15: New bug with hook"expected_message = """Leo Franchi updated [BUG-15: New bug with hook](http://lfranchi.com:8080/browse/BUG-15) (assigned to **Othello, the Moor of Venice**):* Changed assignee to **Othello, the Moor of Venice**"""- self.check_webhook("reassigned_v2", expected_topic_name, expected_message)+ self.check_webhook("issue_updated__reassigned", expected_topic_name, expected_message)def test_priority_updated(self) -> None:expected_topic_name = "TEST-1: Fix That"expected_message = """Leonardo Franchi [Administrator] updated [TEST-1: Fix That](https://zulipp.atlassian.net/browse/TEST-1) (assigned to **[email protected]**):* Changed priority from **Critical** to **Major**"""- self.check_webhook("updated_priority_v2", expected_topic_name, expected_message)+ self.check_webhook("issue_updated__priority", expected_topic_name, expected_message)def test_status_changed(self) -> None:expected_topic_name = "TEST-1: Fix That"expected_message = """Leonardo Franchi [Administrator] updated [TEST-1: Fix That](https://zulipp.atlassian.net/browse/TEST-1):* Changed status from **To Do** to **In Progress**"""- self.check_webhook("change_status_v2", expected_topic_name, expected_message)+ self.check_webhook("issue_updated__status", expected_topic_name, expected_message)def test_comment_created(self) -> None:expected_topic_name = "SP-1: Add support for newer format Jira issue comment events"