o
    gf@                     @   s`   d dl mZmZ d dlmZ d dlmZmZmZ d dl	m
Z
 G dd deZG dd deZd	S )
    )expectedFailureskip)setting)SocialAuthTestsCaseFormParserByIDRefreshParser)override_settingsc                       s    e Zd ZdZ fddZ  ZS )TwitterTestCasetwitterc                    s.   t t| j|i | td| _td| _d S )NTEST_TWITTER_USERTEST_TWITTER_PASSWORD)superr	   setUpr   userpasswd)selfargskwargs	__class__ Z/var/www/html/humari/django-venv/lib/python3.10/site-packages/social_auth/tests/twitter.pyr      s   
zTwitterTestCase.setUp)__name__
__module____qualname__namer   __classcell__r   r   r   r   r	   	   s    r	   c                   @   s&   e Zd Zededddd ZdS )TwitterTestLoginz!TwitterTestCase.setUp() is broken)z5social_auth.backends.pipeline.social.social_auth_userz:social_auth.backends.pipeline.associate.associate_by_emailz/social_auth.backends.pipeline.user.get_usernamez9social_auth.backends.pipeline.misc.save_status_to_sessionz3social_auth.backends.pipeline.social.associate_userz4social_auth.backends.pipeline.social.load_extra_dataz6social_auth.backends.pipeline.user.update_user_details)SOCIAL_AUTH_PIPELINEc           	      C   s>  | j | dd}| |jd | |d }td}|| | j| j	d}| 
|j | 
|j |j| | j|j|jd}d|v rjtd|}| 
|j | 
|j |j| | j|j|jd}n|}t }|| | 
|j | j | |j}| |jd | |d }td	}| 
||k d S )
Nsocialauth_beginr
   i.  Location
oauth_form)zsession[username_or_email]zsession[password])data
login_formLOGIN_REDIRECT_URL)clientgetreverseassertEqualstatus_codeget_contentr   feedr   r   
assertTrueactionvaluesupdater   valuemake_relativer   )	r   responselogin_contentparserauthcontentredirect_pagelocationlogin_redirectr   r   r   test_login_successful   s6   

z&TwitterTestLogin.test_login_successfulN)r   r   r   r   r   r:   r   r   r   r   r      s    	r   N)unittestr   r   social_auth.utilsr   social_auth.tests.baser   r   r   django.test.utilsr   r	   r   r   r   r   r   <module>   s    