From 9aaffb5a19452a7a24da5d96f7a6a34d33f71307 Mon Sep 17 00:00:00 2001 From: Snigdha Sharma Date: Mon, 14 Aug 2023 09:20:18 -0700 Subject: [PATCH] Revert changes to get_attachment --- .../sentry/notifications/test_notifications.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/sentry/notifications/test_notifications.py b/tests/sentry/notifications/test_notifications.py index cc27e031f88a0..574ec002f6137 100644 --- a/tests/sentry/notifications/test_notifications.py +++ b/tests/sentry/notifications/test_notifications.py @@ -43,9 +43,9 @@ def make_event(**kwargs): return result -def get_attachment(response_num): +def get_attachment(): assert len(responses.calls) >= 1 - data = parse_qs(responses.calls[response_num].request.body) + data = parse_qs(responses.calls[0].request.body) assert "text" in data assert "attachments" in data attachments = json.loads(data["attachments"][0]) @@ -135,7 +135,7 @@ def test_sends_note_notification(self): assert isinstance(msg.alternatives[0][0], str) assert "blah blah

" in msg.alternatives[0][0] - attachment, text = get_attachment(0) + attachment, text = get_attachment() # check the Slack version assert text == f"New comment by {self.name}" assert attachment["title"] == f"{self.group.title}" @@ -175,7 +175,7 @@ def test_sends_unassignment_notification(self): assert isinstance(msg.alternatives[0][0], str) assert f"{self.user.username} unassigned" in msg.alternatives[0][0] - attachment, text = get_attachment(0) + attachment, text = get_attachment() assert text == f"Issue unassigned by {self.name}" assert attachment["title"] == self.group.title @@ -205,7 +205,7 @@ def test_sends_resolution_notification(self, record_analytics): assert isinstance(msg.alternatives[0][0], str) assert f"{self.short_id} as resolved

" in msg.alternatives[0][0] - attachment, text = get_attachment(0) + attachment, text = get_attachment() assert ( text @@ -262,7 +262,7 @@ def test_sends_deployment_notification(self, record_analytics): in msg.alternatives[0][0] ) - attachment, text = get_attachment(0) + attachment, text = get_attachment() assert ( text @@ -329,7 +329,7 @@ def test_sends_regression_notification(self, record_analytics): assert isinstance(msg.alternatives[0][0], str) assert f"{group.qualified_short_id} as a regression

" in msg.alternatives[0][0] - attachment, text = get_attachment(0) + attachment, text = get_attachment() assert text == "Issue marked as regression" assert ( @@ -383,7 +383,7 @@ def test_sends_resolved_in_release_notification(self, record_analytics): f'text-decoration: none">{self.short_id} as resolved in' in msg.alternatives[0][0] ) - attachment, text = get_attachment(0) + attachment, text = get_attachment() assert text == f"Issue marked as resolved in {parsed_version} by {self.name}" assert attachment["title"] == self.group.title assert ( @@ -461,7 +461,7 @@ def test_sends_issue_notification(self, record_analytics): assert isinstance(msg.alternatives[0][0], str) assert "Hello world" in msg.alternatives[0][0] - attachment, text = get_attachment(1) + attachment, text = get_attachment() assert attachment["title"] == "Hello world" assert (