Skip to content

Commit

Permalink
de-branch test
Browse files Browse the repository at this point in the history
  • Loading branch information
adlius committed Sep 4, 2024
1 parent 70e19d4 commit 4f85155
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions addons/base/tests/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@

class OAuthAddonAuthViewsTestCaseMixin(OAuthAddonTestCaseMixin):

def setUp(self):

super().setUp()
if self.Provider._oauth_version == 1:
self.expected_oauth_callback_url_path = '/v1/oauth1/callback'
elif self.Provider._oauth_version == 2 :
self.expected_oauth_callback_url_path = '/v1/oauth2/callback'

@property
def ADDON_SHORT_NAME(self):
raise NotImplementedError()
Expand Down Expand Up @@ -78,10 +86,7 @@ def test_oauth_finish_enable_gv(self, mock_requests_get):
gv_callback_url = mock_requests_get.call_args[0][0]
parsed_callback_url = urlparse(gv_callback_url)
assert parsed_callback_url.netloc == urlparse(GRAVYVALET_URL).netloc
if self.Provider._oauth_version == 1:
assert parsed_callback_url.path == '/v1/oauth1/callback'
elif self.Provider._oauth_version == 2:
assert parsed_callback_url.path == '/v1/oauth2/callback'
assert parsed_callback_url.path == self.expected_oauth_callback_url_path
assert dict(parse_qsl(parsed_callback_url.query)) == query_params

def test_delete_external_account(self):
Expand Down

0 comments on commit 4f85155

Please sign in to comment.