File tree Expand file tree Collapse file tree 2 files changed +0
-35
lines changed
tests/sentry/plugins/bases Expand file tree Collapse file tree 2 files changed +0
-35
lines changed Original file line number Diff line number Diff line change 1
1
import logging
2
2
from urllib .error import HTTPError as UrllibHTTPError
3
- from urllib .parse import parse_qs , urlencode , urlparse , urlunparse
4
3
5
4
from django import forms
6
5
from requests .exceptions import HTTPError , SSLError
@@ -186,15 +185,3 @@ def test_configuration_and_get_test_results(self, project):
186
185
else :
187
186
test_results = "No errors returned"
188
187
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
Original file line number Diff line number Diff line change 1
1
from unittest import mock
2
- from urllib .parse import parse_qs , urlparse
3
2
4
3
from requests .exceptions import HTTPError , SSLError
5
4
@@ -20,27 +19,6 @@ def is_configured(self, project) -> bool:
20
19
21
20
22
21
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
-
44
22
def test_notify_failure (self ):
45
23
errors = (
46
24
ApiError ("The server is sad" ),
You can’t perform that action at this time.
0 commit comments