U
    [e	                     @   sH   d dl Z d dlZd dlmZ d dlmZ d dlmZ G dd deZdS )    N)	HTTPretty)	urlencode)
OAuth1Testc                   @   s   e Zd ZdZdZdZedddZe	ddddZ
ed	d
ddiZedddddddddddddddddddddddgd
iZd d! Zd"d# Zd$d% Zd&S )'YahooOAuth1Testz social.backends.yahoo.YahooOAuthz?https://social.yahooapis.com/v1/user/a-guid/profile?format=jsonZfoobarZbearer)Zaccess_token
token_typezfoobar-secrettrue)Zoauth_token_secretZoauth_tokenZoauth_callback_confirmedguidz'https://social.yahooapis.com/v1/me/guidza-guid)urivalueprofileTz2007-12-11T14:40:30Z   z7http://l.yimg.com/dh/ap/social/profile/profile_b192.pngZ192x192)widthZimageUrlsizeheightz2013-03-18T04:15:08Zz3https://social.yahooapis.com/v1/user/a-guid/profileFzhttp://profile.yahoo.com/a-guidfoobar@yahoo.com   HOME)handleidprimarytypezfoobar@email.com   )r   r   r   )
ZbdRestrictedZmemberSinceimagecreatedr	   ZisConnectedZ
profileUrlr   ZnicknameZemailsc                 C   s"   t jt jdd| jd |   d S )Nz3https://social.yahooapis.com/v1/me/guid?format=json   statusbody)r   register_uriGET	guid_bodyZdo_loginself r#   b/var/www/html/services/stratfitenv/lib/python3.8/site-packages/social/tests/backends/test_yahoo.py
test_login;   s    zYahooOAuth1Test.test_loginc                 C   s   |    d S )N)Zdo_partial_pipeliner!   r#   r#   r$   test_partial_pipelineD   s    z%YahooOAuth1Test.test_partial_pipelinec                 C   sL   t jt j| jd| jd t| j}| j|	 d }| 
|d d d S )Nr   r   r   emailr   )r   r   r   user_data_urluser_data_bodyrequestsgetbackendZget_user_detailsjsonassertEqual)r"   responseZuser_detailsr#   r#   r$   test_get_user_detailsG   s    
z%YahooOAuth1Test.test_get_user_detailsN)__name__
__module____qualname__backend_pathr(   Zexpected_usernamer-   dumpsZaccess_token_bodyr   Zrequest_token_bodyr    r)   r%   r&   r0   r#   r#   r#   r$   r   	   s`   	r   )	r-   r*   Z	httprettyr   Z	social.p3r   Zsocial.tests.backends.oauthr   r   r#   r#   r#   r$   <module>   s
   