|
1 | 1 | from unittest import mock
|
2 | 2 |
|
3 | 3 | from allauth.socialaccount.models import SocialAccount
|
| 4 | +from allauth.socialaccount.providers.github.provider import GitHubProvider |
4 | 5 | from django.contrib.auth.models import User
|
5 | 6 | from django.core.exceptions import NON_FIELD_ERRORS
|
6 | 7 | from django.test import TestCase
|
@@ -501,7 +502,9 @@ def setUp(self):
|
501 | 502 | # User with connection
|
502 | 503 | # User without connection
|
503 | 504 | 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 | + ) |
505 | 508 | self.user_email = get(User)
|
506 | 509 |
|
507 | 510 | def test_form_prevalidation_email_user(self):
|
@@ -537,11 +540,17 @@ def test_form_prevalidation_github_user(self):
|
537 | 540 | class TestProjectPrevalidationFormsWithOrganizations(TestCase):
|
538 | 541 | def setUp(self):
|
539 | 542 | 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 | + ) |
541 | 546 | 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 | + ) |
543 | 550 | 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 | + ) |
545 | 554 |
|
546 | 555 | self.organization = get(
|
547 | 556 | Organization,
|
|
0 commit comments