Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
adlius committed Sep 4, 2024
1 parent 4f85155 commit 0ec804f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions addons/base/tests/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from osf.models.external import ExternalProvider
import pytest
from urllib.parse import urlparse, parse_qs
from unittest import mock
Expand Down Expand Up @@ -25,10 +26,12 @@ 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'
if isinstance(self.Provider, ExternalProvider):
# only setup expected_oauth_callback_url_path if the provider uses oauth
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):
Expand Down

0 comments on commit 0ec804f

Please sign in to comment.