-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
@W-14603959 - moving django back to 4 LTS version and address reiew c…
…omments
- Loading branch information
Showing
5 changed files
with
18 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,25 @@ | ||
from ..provider import CustomSalesforceProvider | ||
from allauth.socialaccount.models import SocialApp | ||
import pytest | ||
|
||
|
||
@pytest.fixture | ||
def dummy(): | ||
app = SocialApp.objects.create( | ||
provider=CustomSalesforceProvider.id, | ||
name=CustomSalesforceProvider.id, | ||
client_id="app123id", | ||
key=CustomSalesforceProvider.id, | ||
secret="dummy",) | ||
return app | ||
|
||
|
||
@pytest.mark.django_db | ||
def test_get_auth_params(rf, dummy): | ||
def test_get_auth_params(rf, social_app_factory): | ||
request = rf.get("/") | ||
result = CustomSalesforceProvider(request, dummy).get_auth_params(request, None) | ||
app = social_app_factory( | ||
name=CustomSalesforceProvider.id, | ||
provider=CustomSalesforceProvider.id, | ||
) | ||
result = CustomSalesforceProvider(request, app).get_auth_params(request, None) | ||
assert "prompt" in result and result["prompt"] == "login" | ||
|
||
|
||
@pytest.mark.django_db | ||
def test_extract_uid(rf): | ||
def test_extract_uid(rf, social_app_factory): | ||
request = rf.get("/") | ||
provider = CustomSalesforceProvider(request, dummy) | ||
app = social_app_factory( | ||
name=CustomSalesforceProvider.id, | ||
provider=CustomSalesforceProvider.id, | ||
) | ||
provider = CustomSalesforceProvider(request, app) | ||
result = provider.extract_uid({"organization_id": "ORG", "user_id": "USER"}) | ||
assert result == "ORG/USER" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters