
    )Jfk                     p    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	m
Z
 ddlmZ  G d d	ee
          Zd
S )    )unicode_literals)User)SocialAccount)OAuth2TestsMixin)MockedResponseTestCase   )StravaProviderc                   6    e Zd Zej        Zd Zd Zd ZddZ	dS )StravaTestsc                 "    t          dd          S )N   a  {
                "id": 32641234,
                "username": null,
                "resource_state": 2,
                "firstname": "georges",
                "lastname": "camembert",
                "city": "London",
                "state": "England",
                "country": "United Kingdom",
                "sex": "M",
                "premium": false,
                "summit": false,
                "created_at": "2017-07-12T12:42:52Z",
                "updated_at": "2017-10-21T11:01:23Z",
                "badge_type_id": 0,
                "profile_medium": "avatar/athlete/medium.png",
                "profile": "avatar/athlete/large.png",
                "friend": null,
                "follower": null,
                "email": "bill@example.com"
            }r   selfs    o/home/alex/cs2snipeproduction/venv/lib/python3.11/site-packages/allauth/socialaccount/providers/strava/tests.pyget_mocked_responsezStravaTests.get_mocked_response   s    
 
 	
    c                 "    t          dd          S )zkProfile including realistic avatar URL
        user ID set to 0 to test edge case where id would be missingr   a  {
                "id": 0,
                "username": null,
                "resource_state": 2,
                "firstname": "georges",
                "lastname": "camembert",
                "city": "London",
                "state": "England",
                "country": "United Kingdom",
                "sex": "M",
                "premium": false,
                "summit": false,
                "created_at": "2017-07-12T12:42:52Z",
                "updated_at": "2017-10-21T11:01:23Z",
                "badge_type_id": 0,
                "profile_medium": "https://cloudfront.net/1/medium.jpg",
                "profile": "https://cloudfront.net/1/large.jpg",
                "friend": null,
                "follower": null,
                "email": "bill@example.com"
            }r   r   s    r   %get_mocked_response_avatar_invalid_idz1StravaTests.get_mocked_response_avatar_invalid_id*   s     
 
 	
r   c                    |                      |                                            t          j                            d          }t
          j                            || j        j                                                  }|	                                }| 
                    |                                d           |                     |                                           dS )ztest response with Avatar URLzbill@example.com)email)userproviderz"https://cloudfront.net/1/large.jpgN)loginr   r   objectsgetr   filterr   idget_provider_accountassertEqualget_avatar_urlassertIsNoneget_profile_url)r   r   soc_accprovider_accounts       r   test_valid_avatarzStravaTests.test_valid_avatarF   s    

4==??@@@|&899'.. 0 / 
 

#%% 	 #7799++--0	
 	
 	
 	*::<<=====r   Tc                     d}|rd}d|z  S )N z,"refresh_token": "testrf"a$  {
            "uid":"weibo",
            "access_token":"testac",
            "livemode": false,
            "token_type": "bearer",
            "strava_publishable_key": "pk_test_someteskey",
            "strava_user_id": "acct_sometestid",
            "scope": "read_write"
            %s } )r   with_refresh_tokenrts      r   get_login_response_jsonz#StravaTests.get_login_response_jsonT   s(     	.-B 		
r   N)T)
__name__
__module____qualname__r
   r   provider_idr   r   r'   r-   r*   r   r   r   r      s]         #K
 
 
4
 
 
8> > >
 
 
 
 
 
r   r   N)
__future__r   django.contrib.auth.modelsr   allauth.socialaccount.modelsr   allauth.socialaccount.testsr   allauth.testsr   r   r   r
   r   r*   r   r   <module>r7      s    ' ' ' ' ' ' + + + + + + 6 6 6 6 6 6 8 8 8 8 8 8 2 2 2 2 2 2 2 2 $ $ $ $ $ $V
 V
 V
 V
 V
"H V
 V
 V
 V
 V
r   