Skip to content

Commit

Permalink
tests(amazon_cognito): Test utils
Browse files Browse the repository at this point in the history
  • Loading branch information
pennersr committed Nov 3, 2023
1 parent 6444a8c commit a11bd00
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions allauth/socialaccount/providers/amazon_cognito/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@

from django.test import override_settings

import pytest

from allauth.account.models import EmailAddress
from allauth.socialaccount.models import SocialAccount
from allauth.socialaccount.providers.amazon_cognito.provider import (
AmazonCognitoProvider,
)
from allauth.socialaccount.providers.amazon_cognito.utils import (
convert_to_python_bool_if_value_is_json_string_bool,
)
from allauth.socialaccount.providers.amazon_cognito.views import (
AmazonCognitoOAuth2Adapter,
)
Expand Down Expand Up @@ -67,3 +72,16 @@ def test_saves_email_as_verified_if_email_is_verified_in_cognito(

def test_provider_slug_replaces_underscores_with_hyphens(self):
self.assertTrue("_" not in self.provider.get_slug())


@pytest.mark.parametrize(
"input,output",
[
(True, True),
("true", True),
("false", False),
(False, False),
],
)
def test_convert_bool(input, output):
assert convert_to_python_bool_if_value_is_json_string_bool(input) == output

0 comments on commit a11bd00

Please sign in to comment.