o
    Lf                     @   sj   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 )    N)RequestFactory)override_settings)OAuth2TestsMixin)MockedResponseTestCase   )AuthentiqProvider)AuthentiqOAuth2Adapterc                   @   s   e Zd ZejZdd Zedd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   
ZLARGMFT1Mzjane@email.invalidTJaneDoe)subemailemail_verified
given_namefamily_name)r   jsondumps)self r   p/var/www/html/humari/django-venv/lib/python3.10/site-packages/allauth/socialaccount/providers/authentiq/tests.pyget_mocked_response   s   z"AuthentiqTests.get_mocked_responseF)SOCIALACCOUNT_QUERY_EMAILc                 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      
z+AuthentiqTests.test_default_scopes_no_emailTc                 C   s&   | j  }| d| | d| d S r   )r   r   r   r!   r   r   r   test_default_scopes_email&   r$   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 )Nfoo)scoper&   r   )r   r(   r	   r)   dictr   r*   r   r+   r   r   r   test_dynamic_scopes4   s   z"AuthentiqTests.test_dynamic_scopes)r   SOCIALACCOUNT_EMAIL_REQUIRED SOCIALACCOUNT_EMAIL_VERIFICATIONc                 C   6   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=      z2AuthentiqTests.test_scopes_required_verified_emailc                 C   r4   )Nzemail~sr   r5   r+   r   r   r   #test_scopes_optional_verified_emailH   r7   z2AuthentiqTests.test_scopes_optional_verified_emailc                 C   r4   )Nzemail~rr   r5   r+   r   r   r   test_scopes_required_emailS   r7   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   idprovider_idr   r   r#   r%   r-   r1   r6   r8   r9   r:   r   r   r   r   r
      sJ    

	


r
   )r   django.test.clientr   django.test.utilsr   allauth.socialaccount.testsr   allauth.testsr   r   r   r   viewsr	   r
   r   r   r   r   <module>   s    