
    f                     V    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e	      Z
y)	    )get_user_model)override_settings)app_settings)AuthenticationBackend)TestCasec                       e Zd Zd Z eej                  j                        d        Z eej                  j                        d        Z
 eej                  j                        d        Zy)AuthenticationBackendTestsc                     t               j                  j                  ddd      }|j                  |j                         |j                          || _        y )NTzjohn@example.comjohn)	is_activeemailusername)r   objectscreateset_passwordr   saveuser)selfr   s     c/var/www/cs2snipe.com/venv/lib/python3.12/site-packages/allauth/account/tests/test_auth_backends.pysetUpz AuthenticationBackendTests.setUp
   sL    ''.."4v / 
 	$--(			    )ACCOUNT_AUTHENTICATION_METHODc                 8   | j                   }t               }| j                  |j                  d |j                  |j                        j
                  |j
                         | j                  |j                  d |j                  |j                        d        y N)requestr   password)r   r   assertEqualauthenticater   pkr   r   r   backends      r   test_auth_by_usernamez0AuthenticationBackendTests.test_auth_by_username   s     yy')  t}}t}} ! bGG		
 	  tzzDMM !  		
r   c                 8   | j                   }t               }| j                  |j                  d |j                  |j
                        j                  |j                         | j                  |j                  d |j
                  |j
                        d        y r   r   r   r   r   r   r   r   r    s      r   test_auth_by_emailz-AuthenticationBackendTests.test_auth_by_email%   s     yy')  tzzDMM ! bGG		
 	  t}}t}} !  		
r   c                 `   | j                   }t               }| j                  |j                  d |j                  |j
                        j                  |j                         | j                  |j                  d |j
                  |j
                        j                  |j                         y r   r$   r    s      r   test_auth_by_username_or_emailz9AuthenticationBackendTests.test_auth_by_username_or_email8   s     yy')  tzzDMM ! bGG		
 	  t}}t}} ! bGG		
r   N)__name__
__module____qualname__r   r   r   AuthenticationMethodUSERNAMEr"   EMAILr%   USERNAME_EMAILr'    r   r   r	   r	   	   s     &2&G&G&P&P

  &2&G&G&M&M

  &2&G&G&V&V

r   r	   N)django.contrib.authr   django.test.utilsr   allauth.accountr   allauth.account.auth_backendsr   allauth.testsr   r	   r/   r   r   <module>r5      s"    . / ( ? "@
 @
r   