Skip to content

Commit ff56366

Browse files
authored
Tests: set provider explicitly (#11342)
Will fix the tests from readthedocs/readthedocs-corporate#1788
1 parent 411e177 commit ff56366

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

readthedocs/rtd_tests/tests/test_project_forms.py

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from unittest import mock
22

33
from allauth.socialaccount.models import SocialAccount
4+
from allauth.socialaccount.providers.github.provider import GitHubProvider
45
from django.contrib.auth.models import User
56
from django.core.exceptions import NON_FIELD_ERRORS
67
from django.test import TestCase
@@ -501,7 +502,9 @@ def setUp(self):
501502
# User with connection
502503
# User without connection
503504
self.user_github = get(User)
504-
self.social_github = get(SocialAccount, user=self.user_github)
505+
self.social_github = get(
506+
SocialAccount, user=self.user_github, provider=GitHubProvider.id
507+
)
505508
self.user_email = get(User)
506509

507510
def test_form_prevalidation_email_user(self):
@@ -537,11 +540,17 @@ def test_form_prevalidation_github_user(self):
537540
class TestProjectPrevalidationFormsWithOrganizations(TestCase):
538541
def setUp(self):
539542
self.user_owner = get(User)
540-
self.social_owner = get(SocialAccount, user=self.user_owner)
543+
self.social_owner = get(
544+
SocialAccount, user=self.user_owner, provider=GitHubProvider.id
545+
)
541546
self.user_admin = get(User)
542-
self.social_admin = get(SocialAccount, user=self.user_admin)
547+
self.social_admin = get(
548+
SocialAccount, user=self.user_admin, provider=GitHubProvider.id
549+
)
543550
self.user_readonly = get(User)
544-
self.social_readonly = get(SocialAccount, user=self.user_readonly)
551+
self.social_readonly = get(
552+
SocialAccount, user=self.user_readonly, provider=GitHubProvider.id
553+
)
545554

546555
self.organization = get(
547556
Organization,

0 commit comments

Comments
 (0)