File tree Expand file tree Collapse file tree 3 files changed +29
-11
lines changed Expand file tree Collapse file tree 3 files changed +29
-11
lines changed Original file line number Diff line number Diff line change @@ -105,12 +105,13 @@ def create_session(self):
105
105
}
106
106
)
107
107
108
+ social_app = self .account .get_provider ().app
108
109
self .session = OAuth2Session (
109
- client_id = token . app .client_id ,
110
+ client_id = social_app .client_id ,
110
111
token = token_config ,
111
112
auto_refresh_kwargs = {
112
- "client_id" : token . app .client_id ,
113
- "client_secret" : token . app .secret ,
113
+ "client_id" : social_app .client_id ,
114
+ "client_secret" : social_app .secret ,
114
115
},
115
116
auto_refresh_url = self .get_adapter ().access_token_url ,
116
117
token_updater = self .token_updater (token ),
Original file line number Diff line number Diff line change 1
1
import django_dynamic_fixture as fixture
2
2
import requests_mock
3
- from allauth .socialaccount .models import SocialAccount , SocialApp , SocialToken
3
+ from allauth .socialaccount .models import SocialAccount , SocialToken
4
4
from allauth .socialaccount .providers .github .views import GitHubOAuth2Adapter
5
5
from django .contrib .auth .models import User
6
6
from django .test import TestCase
@@ -61,18 +61,13 @@ class GitHubOAuthSyncTests(TestCase):
61
61
62
62
def setUp (self ):
63
63
self .user = fixture .get (User )
64
- self .socialapp = fixture .get (
65
- SocialApp ,
66
- provider = GitHubOAuth2Adapter .provider_id ,
67
- )
68
64
self .socialaccount = fixture .get (
69
65
SocialAccount ,
70
66
user = self .user ,
71
67
provider = GitHubOAuth2Adapter .provider_id ,
72
68
)
73
69
self .token = fixture .get (
74
70
SocialToken ,
75
- app = self .socialapp ,
76
71
account = self .socialaccount ,
77
72
)
78
73
self .service = GitHubService .for_user (self .user )[0 ]
@@ -293,7 +288,6 @@ def test_sync_repositories_only_creates_one_remote_repo_per_vcs_repo(
293
288
)
294
289
fixture .get (
295
290
SocialToken ,
296
- app = self .socialapp ,
297
291
account = user_2_socialaccount ,
298
292
)
299
293
Original file line number Diff line number Diff line change @@ -646,6 +646,13 @@ def DOCKER_LIMITS(self):
646
646
647
647
SOCIALACCOUNT_PROVIDERS = {
648
648
'github' : {
649
+ "APPS" : [
650
+ {
651
+ "client_id" : "123" ,
652
+ "secret" : "456" ,
653
+ "key" : ""
654
+ },
655
+ ],
649
656
"VERIFIED_EMAIL" : True ,
650
657
'SCOPE' : [
651
658
'user:email' ,
@@ -655,13 +662,29 @@ def DOCKER_LIMITS(self):
655
662
],
656
663
},
657
664
'gitlab' : {
665
+ "APPS" : [
666
+ {
667
+ "client_id" : "123" ,
668
+ "secret" : "456" ,
669
+ "key" : ""
670
+ },
671
+ ],
658
672
"VERIFIED_EMAIL" : True ,
659
673
'SCOPE' : [
660
674
'api' ,
661
675
'read_user' ,
662
676
],
663
677
},
664
- # Bitbucket scope/permissions are determined by the Oauth consumer setup on bitbucket.org
678
+ "bitbucket_oauth2" : {
679
+ "APPS" : [
680
+ {
681
+ "client_id" : "123" ,
682
+ "secret" : "456" ,
683
+ "key" : ""
684
+ },
685
+ ],
686
+ # Bitbucket scope/permissions are determined by the Oauth consumer setup on bitbucket.org.
687
+ },
665
688
}
666
689
ACCOUNT_FORMS = {
667
690
'signup' : 'readthedocs.forms.SignupFormWithNewsletter' ,
You can’t perform that action at this time.
0 commit comments