Skip to content

Commit f4ba954

Browse files
ref: remove unused add_notification_referrer_param
introduced in 89742db but never called
1 parent 6abb058 commit f4ba954

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

src/sentry/plugins/bases/notify.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import logging
22
from urllib.error import HTTPError as UrllibHTTPError
3-
from urllib.parse import parse_qs, urlencode, urlparse, urlunparse
43

54
from django import forms
65
from requests.exceptions import HTTPError, SSLError
@@ -186,15 +185,3 @@ def test_configuration_and_get_test_results(self, project):
186185
else:
187186
test_results = "No errors returned"
188187
return test_results
189-
190-
def add_notification_referrer_param(self, url):
191-
if self.slug:
192-
parsed_url = urlparse(url)
193-
query = parse_qs(parsed_url.query)
194-
query["referrer"] = self.slug
195-
196-
url_list = list(parsed_url)
197-
url_list[4] = urlencode(query, doseq=True)
198-
return urlunparse(url_list)
199-
200-
return url

tests/sentry/plugins/bases/test_notify.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from unittest import mock
2-
from urllib.parse import parse_qs, urlparse
32

43
from requests.exceptions import HTTPError, SSLError
54

@@ -20,27 +19,6 @@ def is_configured(self, project) -> bool:
2019

2120

2221
class NotifyPluginTest(TestCase):
23-
def test_add_notification_referrer_param(self):
24-
n = DummyNotificationPlugin()
25-
n.slug = "slack"
26-
url = "https://sentry.io/"
27-
assert n.add_notification_referrer_param(url) == url + "?referrer=" + n.slug
28-
29-
url = "https://sentry.io/?referrer=notslack"
30-
assert n.add_notification_referrer_param(url) == "https://sentry.io/?referrer=slack"
31-
32-
url = "https://sentry.io/?utm_source=google"
33-
with_referrer = n.add_notification_referrer_param(url)
34-
35-
# XXX(py3): Handle ordering differences between py2/3
36-
assert parse_qs(urlparse(with_referrer).query) == parse_qs(
37-
"referrer=slack&utm_source=google"
38-
)
39-
40-
n.slug = ""
41-
url = "https://sentry.io/"
42-
assert n.add_notification_referrer_param(url) == "https://sentry.io/"
43-
4422
def test_notify_failure(self):
4523
errors = (
4624
ApiError("The server is sad"),

0 commit comments

Comments
 (0)