o
    Lf                     @   sP   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	 G dd de	Z
dS )	    )get_user_model)override_settings)app_settings)AuthenticationBackend)TestCasec                   @   sV   e Zd Zdd Zeejjddd Zeejj	ddd Z
eejjddd	 Zd
S )AuthenticationBackendTestsc                 C   s2   t  jjdddd}||j |  || _d S )NTzjohn@example.comjohn)	is_activeemailusername)r   objectscreateset_passwordr   saveuser)selfr    r   i/var/www/html/humari/django-venv/lib/python3.10/site-packages/allauth/account/tests/test_auth_backends.pysetUp
   s   
z AuthenticationBackendTests.setUp)ACCOUNT_AUTHENTICATION_METHODc                 C   sL   | j }t }| |jd |j|jdj|j | |jd |j|jdd  d S N)requestr   password)r   r   assertEqualauthenticater   pkr
   r   r   backendr   r   r   test_auth_by_username      

z0AuthenticationBackendTests.test_auth_by_usernamec                 C   sL   | j }t }| |jd |j|jdj|j | |jd |j|jdd  d S r   r   r   r   r   r
   r   r   r   r   r   r   test_auth_by_email%   r   z-AuthenticationBackendTests.test_auth_by_emailc                 C   sP   | j }t }| |jd |j|jdj|j | |jd |j|jdj|j d S r   r    r   r   r   r   test_auth_by_username_or_email8   s    

z9AuthenticationBackendTests.test_auth_by_username_or_emailN)__name__
__module____qualname__r   r   r   AuthenticationMethodUSERNAMEr   EMAILr!   USERNAME_EMAILr"   r   r   r   r   r   	   s    

r   N)django.contrib.authr   django.test.utilsr   allauth.accountr   allauth.account.auth_backendsr   allauth.testsr   r   r   r   r   r   <module>   s    