From 0ec804ff841906292b265d57b4e53d75e1298cfa Mon Sep 17 00:00:00 2001 From: Yuhuai Liu Date: Wed, 4 Sep 2024 08:37:35 -0400 Subject: [PATCH] fix test --- addons/base/tests/views.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/addons/base/tests/views.py b/addons/base/tests/views.py index 81593c557a6..08eb876742b 100644 --- a/addons/base/tests/views.py +++ b/addons/base/tests/views.py @@ -1,3 +1,4 @@ +from osf.models.external import ExternalProvider import pytest from urllib.parse import urlparse, parse_qs from unittest import mock @@ -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):