
    )Jfj
                        d dl Z d dlmZ d dlZd dlmZ d dlmZ d dlm	Z	 d dl
mZ d dlmZ d dlmZ d d	lmZmZ d
 Z edddii           G d dee                      Zej                            dg d          d             ZdS )    N)override_settings)EmailAddress)SocialAccount)AmazonCognitoProvider3convert_to_python_bool_if_value_is_json_string_bool)AmazonCognitoOAuth2Adapter)OAuth2TestsMixin)MockedResponseTestCasec                      ddddddS )Nz$4993b410-8a1b-4c36-b843-a9c1a697e6b7JohnDoezjdoe@example.comjohndoe)sub
given_namefamily_nameemailusername r       w/home/alex/cs2snipeproduction/venv/lib/python3.11/site-packages/allauth/socialaccount/providers/amazon_cognito/tests.py_get_mocked_claimsr      s     5#  r   amazon_cognitoDOMAINz/https://domain.auth.us-east-1.amazoncognito.comSOCIALACCOUNT_PROVIDERSc                   \    e Zd Zej        Zd Z edi i          d             Zd Z	d Z
dS )AmazonCognitoTestCasec                 d    t          j        t                                }t          d|          S )N   status_codecontent)jsondumpsr   r   )selfmocked_payloads     r   get_mocked_responsez)AmazonCognitoTestCase.get_mocked_response(   s+    $6$8$899#~FFFFr   r   r   c                     |                                  }|                     t          t          j                  5  |                     |           d d d            d S # 1 swxY w Y   d S )N)msg)r)   assertRaises
ValueErrorr	   DOMAIN_KEY_MISSING_ERRORlogin)r'   mocked_responses     r   8test_oauth2_adapter_raises_if_domain_settings_is_missingzNAmazonCognitoTestCase.test_oauth2_adapter_raises_if_domain_settings_is_missing-   s     2244*C  
 
 	( 	( JJ'''		( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	(s   AA"%A"c                    t                      }d|d<   t          j        |          }t          d|          }|                     |           t
          j                            |d                   j        }t          j                            |          }| 
                    |j        |d                    |                     |j                   d S )	NTemail_verifiedr!   r"   r   )uid)user_idr   )r   r%   r&   r   r/   r   objectsgetr5   r   assertEqualr   
assertTrueverified)r'   mocked_claimsr(   r0   r5   email_addresss         r   <test_saves_email_as_verified_if_email_is_verified_in_cognitozRAmazonCognitoTestCase.test_saves_email_as_verified_if_email_is_verified_in_cognito9   s     +,,*.&'M22(S.QQQ

?###'++e0D+EEM$,000AA,mG.DEEE./////r   c                 b    |                      d| j                                        v           d S )N_)r9   providerget_slug)r'   s    r   4test_provider_slug_replaces_underscores_with_hyphenszJAmazonCognitoTestCase.test_provider_slug_replaces_underscores_with_hyphensI   s-    4=#9#9#;#;;<<<<<r   N)__name__
__module____qualname__r   idprovider_idr)   r   r1   r=   rB   r   r   r   r   r       s         (*KG G G
 0@"/EFFF	( 	( GF	(0 0 0 = = = = =r   r   zinput,output))TT)trueT)falseF)FFc                 0    t          |           |k    sJ d S )Nr   )inputoutputs     r   test_convert_boolrM   M   s#     ?uEEOOOOOOr   )r%   django.testr   pytestallauth.account.modelsr   allauth.socialaccount.modelsr   7allauth.socialaccount.providers.amazon_cognito.providerr   4allauth.socialaccount.providers.amazon_cognito.utilsr   4allauth.socialaccount.providers.amazon_cognito.viewsr	   allauth.socialaccount.testsr
   allauth.testsr   r   r   r   markparametrizerM   r   r   r   <module>rY      s    ) ) ) ) ) )  / / / / / / 6 6 6 6 6 6                9 8 8 8 8 8 2 2 2 2 2 2 2 2   8%VW  
%= %= %= %= %=,h %= %= 
%=P    P P P P Pr   