
    )Jf                     l    d dl Z d dlmZ d dlmZ d dlmZmZ ddlm	Z	 ddl
mZ  G d d	ee          ZdS )
    N)OAuth2Error)OAuth2TestsMixin)MockedResponseTestCase   )MicrosoftGraphProvider)_check_errorsc                   4    e Zd Zej        Zd Zd Zd Zd Z	dS )MicrosoftGraphTestsc                 &    d}t          d|          S )Na  
        {
            "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users/$entity",
            "id": "16f5a7b6-5a15-4568-aa5a-31bb117e9967",
            "businessPhones": [],
            "displayName": "Anne Weiler",
            "givenName": "Anne",
            "jobTitle": "Manufacturing Lead",
            "mail": "annew@CIE493742.onmicrosoft.com",
            "mobilePhone": "+1 3528700812",
            "officeLocation": null,
            "preferredLanguage": "en-US",
            "surname": "Weiler",
            "userPrincipalName": "annew@CIE493742.onmicrosoft.com",
            "mailNickname": "annew"
        }
           )r   )selfresponse_datas     r/home/alex/cs2snipeproduction/venv/lib/python3.11/site-packages/allauth/socialaccount/providers/microsoft/tests.pyget_mocked_responsez'MicrosoftGraphTests.get_mocked_response   s    " c=111    c                     t          dt          j        i                     }|                     t                    5  t          |           d d d            d S # 1 swxY w Y   d S )Nr   r   jsondumpsassertRaisesr   r	   r   responses     r   test_invalid_dataz%MicrosoftGraphTests.test_invalid_data"   s    !#tz"~~66{++ 	$ 	$(###	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$s   AA!Ac                     ddddi}t          dt          j        |                    }|                     t                    5  t          |           d d d            d S # 1 swxY w Y   d S )NerrorInvalidAuthenticationTokenz2Access token validation failure. Invalid audience.)codemessagei  r   )r   datar   s      r   test_profile_invalid_responsez1MicrosoftGraphTests.test_profile_invalid_response(   s    4O 
 "#tz$'7'788{++ 	$ 	$(###	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$s   A!!A%(A%c                     t          dd          }|                     t                    5  t          |           d d d            d S # 1 swxY w Y   d S )Nr   zinvalid json data)r   r   r   r	   r   s     r   test_invalid_responsez)MicrosoftGraphTests.test_invalid_response5   s    !#':;;{++ 	$ 	$(###	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$s   AAAN)
__name__
__module____qualname__r   idprovider_idr   r   r!   r#    r   r   r   r      sX        (+K2 2 2($ $ $$ $ $$ $ $ $ $r   r   )r   -allauth.socialaccount.providers.oauth2.clientr   allauth.socialaccount.testsr   allauth.testsr   r   providerr   viewsr	   r   r)   r   r   <module>r/      s     E E E E E E 8 8 8 8 8 8 2 2 2 2 2 2 2 2 , , , , , ,            .$ .$ .$ .$ .$*H .$ .$ .$ .$ .$r   