a
    Qx_                     @   sz   d dl mZ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mZ ddlmZ dd	lmZ G d
d de	eZdS )    )absolute_importunicode_literalsN)RequestFactory)override_settings)OAuth2TestsMixin)MockedResponseTestCase   )AuthentiqProvider)AuthentiqOAuth2Adapterc                   @   s   e Zd ZejZdd Zdd Zedddd Z	d	d
 Z
dd Zedddddd Zedddddd Zedddddd Zedddddd ZdS )AuthentiqTestsc              
   C   s   t dtddddddS )N   Z
ZLARGMFT1Mzjane@email.invalidTZJaneZDoe)subemailZemail_verifiedZ
given_nameZfamily_name)r   jsondumps)self r   g/var/www/html/Ranjet/env/lib/python3.9/site-packages/allauth/socialaccount/providers/authentiq/tests.pyget_mocked_response   s    z"AuthentiqTests.get_mocked_responsec                 C   s&   | j  }| d| | d| d S Naq:namer   )providerget_default_scopeassertInassertNotInr   scopesr   r   r   test_default_scopes_no_email!   s    
z+AuthentiqTests.test_default_scopes_no_emailT)SOCIALACCOUNT_QUERY_EMAILc                 C   s&   | j  }| d| | d| d S r   )r   r   r   r   r   r   r   test_default_scopes_email&   s    
z(AuthentiqTests.test_default_scopes_emailc                 C   s6   t  tj}| j|}| d| | d| d S )Nopenidr   r   getr   authorize_urlr   	get_scoper   r   requestr   r   r   r   test_scopes.   s    zAuthentiqTests.test_scopesc                 C   sJ   t  tjtdd}| j|}| d| | d| | d| d S )NZfoo)Zscoper!   r   )r   r#   r   r$   dictr   r%   r   r&   r   r   r   test_dynamic_scopes4   s    z"AuthentiqTests.test_dynamic_scopes)r   ZSOCIALACCOUNT_EMAIL_REQUIREDZ SOCIALACCOUNT_EMAIL_VERIFICATIONc                 C   s6   t  tj}| j|}| d| | d| d S )Nzemail~rsr   r   r#   r   r$   r   r%   r   r   r&   r   r   r   #test_scopes_required_verified_email=   s    z2AuthentiqTests.test_scopes_required_verified_emailFc                 C   s6   t  tj}| j|}| d| | d| d S )Nzemail~sr   r+   r&   r   r   r   #test_scopes_optional_verified_emailH   s    z2AuthentiqTests.test_scopes_optional_verified_emailc                 C   s6   t  tj}| j|}| d| | d| d S )Nzemail~rr   r+   r&   r   r   r   test_scopes_required_emailS   s    z)AuthentiqTests.test_scopes_required_emailc                 C   s*   t  tj}| j|}| d| d S )Nr   r"   r&   r   r   r   test_scopes_optional_email^   s    z)AuthentiqTests.test_scopes_optional_emailN)__name__
__module____qualname__r
   idZprovider_idr   r   r   r    r(   r*   r,   r-   r.   r/   r   r   r   r   r      sB   
	


r   )
__future__r   r   r   Zdjango.test.clientr   Zdjango.test.utilsr   Zallauth.socialaccount.testsr   Zallauth.testsr   r   r   r
   Zviewsr   r   r   r   r   r   <module>   s   