
    f                     p    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
ee	      Zy)    N)RequestFactory)override_settings)OAuth2TestsMixin)MockedResponseTestCase   )AuthentiqProvider)AuthentiqOAuth2Adapterc                       e Zd Zej                  Zd Zd Z ed      d        Z	 ed      d        Z
d Zd	 Z eddd
      d        Z eddd
      d        Z eddd
      d        Z eddd
      d        Zy)AuthentiqTestsc                 L    t        dt        j                  dddddd            S )N   
ZLARGMFT1Mjane@email.invalidTJaneDoe)subemailemail_verified
given_namefamily_name)r   jsondumpsselfs    j/var/www/cs2snipe.com/venv/lib/python3.12/site-packages/allauth/socialaccount/providers/authentiq/tests.pyget_mocked_responsez"AuthentiqTests.get_mocked_response   s2    JJ'1&*"(#(
 	
    c                      y)Nr    r   s    r   get_expected_to_strz"AuthentiqTests.get_expected_to_str   s    #r   F)SOCIALACCOUNT_QUERY_EMAILc                     | j                   j                         }| j                  d|       | j                  d|       y Naq:namer   )providerget_default_scopeassertInassertNotInr   scopess     r   test_default_scopes_no_emailz+AuthentiqTests.test_default_scopes_no_email!   s4     002i(&)r   Tc                     | j                   j                         }| j                  d|       | j                  d|       y r$   )r&   r'   r(   r*   s     r   test_default_scopes_emailz(AuthentiqTests.test_default_scopes_email)   s2     002i(gv&r   c                     t               j                  t        j                        }| j                  j                  |      }| j                  d|       | j                  d|       y )Nopenidr%   r   getr
   authorize_urlr&   get_scope_from_requestr(   r   requestr+   s      r   test_scopeszAuthentiqTests.test_scopes1   sL     "&&'='K'KL55g>h'i(r   c                 
   t               j                  t        j                  t	        d            }| j
                  j                  |      }| j                  d|       | j                  d|       | j                  d|       y )Nfoo)scoper0   r%   )r   r2   r
   r3   dictr&   r4   r(   r5   s      r   test_dynamic_scopesz"AuthentiqTests.test_dynamic_scopes7   se     "&&"00$U2C
 55g>h'i(eV$r   )r"   SOCIALACCOUNT_EMAIL_REQUIRED SOCIALACCOUNT_EMAIL_VERIFICATIONc                     t               j                  t        j                        }| j                  j                  |      }| j                  d|       | j                  d|       y )Nzemail~rsr   r   r2   r
   r3   r&   r4   r(   r)   r5   s      r   #test_scopes_required_verified_emailz2AuthentiqTests.test_scopes_required_verified_email@   sP     !"&&'='K'KL55g>j&)&)r   c                     t               j                  t        j                        }| j                  j                  |      }| j                  d|       | j                  d|       y )Nzemail~sr   r@   r5   s      r   #test_scopes_optional_verified_emailz2AuthentiqTests.test_scopes_optional_verified_emailK   P     !"&&'='K'KL55g>i(&)r   c                     t               j                  t        j                        }| j                  j                  |      }| j                  d|       | j                  d|       y )Nzemail~rr   r@   r5   s      r   test_scopes_required_emailz)AuthentiqTests.test_scopes_required_emailV   rD   r   c                     t               j                  t        j                        }| j                  j                  |      }| j                  d|       y )Nr   r1   r5   s      r   test_scopes_optional_emailz)AuthentiqTests.test_scopes_optional_emaila   s@     !"&&'='K'KL55g>gv&r   N)__name__
__module____qualname__r	   idprovider_idr   r!   r   r,   r.   r7   r<   rA   rC   rF   rH   r    r   r   r   r      s    #&&K
$ "'**
 "&''
)% "&%))-
*
* "&%*)-
*
* "&%)).
*
* "&%*).
'
'r   r   )r   django.test.clientr   django.test.utilsr   allauth.socialaccount.testsr   allauth.testsr   r   r&   r	   viewsr
   r   r    r   r   <module>rS      s+     - / 8 2 ' )\'%x \'r   