Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

create socialApp for allauth oauth in authProxyMiddlewareTests

pankaj-basnetb06cbb795577
diff --git a/wger/core/tests/test_auth_proxy_middleware.py b/wger/core/tests/test_auth_proxy_middleware.py
index 3be20fc22..ecace4568 100644
--- a/wger/core/tests/test_auth_proxy_middleware.py
+++ b/wger/core/tests/test_auth_proxy_middleware.py
@@ -23,7 +23,7 @@ from django.urls import reverse
# Third Party
from allauth.account.models import EmailAddress
-
+from allauth.socialaccount.models import SocialApp
User = get_user_model()
@@ -52,6 +52,11 @@ class AuthProxyMiddlewareTests(TestCase):
self.protected_url = reverse('core:dashboard')
self.login_url = reverse('core:user:login')
+ # oauth
+ SocialApp.objects.create(
+ provider='google', name='Google', client_id='dummy', secret='dummy'
+ )
+
# Helper to make requests with specific IP and header
def make_request(
self,
diff --git a/wger/utils/context_processor.py b/wger/utils/context_processor.py
index d24282d8b..fd294e47f 100644
--- a/wger/utils/context_processor.py
+++ b/wger/utils/context_processor.py
@@ -35,8 +35,7 @@ def processor(request):
context = {
'mastodon': settings.WGER_SETTINGS.get('MASTODON', ''),
'allow_registration': settings.WGER_SETTINGS.get('ALLOW_REGISTRATION', False),
- # 'use_social_auth': settings.WGER_SETTINGS.get('USE_SOCIAL_AUTH', False),
- 'use_social_auth': True,
+ 'use_social_auth': settings.WGER_SETTINGS.get('USE_SOCIAL_AUTH', False),
'use_github_auth': settings.WGER_SETTINGS.get('USE_GITHUB_AUTH', False),
'use_facebook_auth': settings.WGER_SETTINGS.get('USE_FACEBOOK_AUTH', False),