Ë
    ûûàgm  ã                   óx   — d dl mZmZ 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y)é    )Úparse_qsÚurlparse)ÚTestCase)Úreverse)Ú	urlencode)ÚOAuth2TestsMixin)ÚMockedResponseÚmocked_responseé   )ÚNotionProviderc                   óD   — e Zd Zej                  ZdZd„ Zd„ Zdd„Z	dd„Z
y)	ÚNotionTestsFc                 ó   — t        dd«      S )NéÈ   a®  
            {
                "workspace_id": "workspace-abc",
                "workspace_name": "My Workspace",
                "owner": {
                    "user": {
                        "id": "test123",
                        "name": "John Doe",
                        "avatar_url": "",
                        "person": {"email": "john@example.com"},
                    }
                },
            }
            )r	   ©Úselfs    új/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/allauth/socialaccount/providers/notion/tests.pyÚget_mocked_responsezNotionTests.get_mocked_response   s   € ÜØðó
ð 	
ó    c                  ó   — y)NzJohn Doe (My Workspace)© r   s    r   Úget_expected_to_strzNotionTests.get_expected_to_str$   s   € Ø(r   c                  ó   — y)zœ
        Docs here:
        https://developers.notion.com/docs/authorization#step-4-notion-responds-with-an-access_token-and-additional-information
        aŽ  
        {
            "access_token": "testac",
            "bot_id": "bot-abc",
            "duplicated_template_id": "template-abc",
            "owner": {
            "workspace_id": "workspace-abc",
                "user": {
                    "id": "test123",
                    "name": "John Doe",
                    "avatar_url": "",
                    "person": {
                        "email": "john@example.com"
                    }
                }
            },
            "workspace_icon": "https://example.com/icon.png",
            "workspace_id": "workspace-abc",
            "workspace_name": "My Workspace"
        }
        r   )r   Úwith_refresh_tokens     r   Úget_login_response_jsonz#NotionTests.get_login_response_json'   s   € ð
r   Nc                 óF  — | j                   j                  t        | j                  j                  dz   «      dz   t        t        |¬«      «      z   «      }t        |d   «      }t        |j                  «      }t        | j                  j                  dz   «      }| j                  |¬«      }t        |t        «      r|}	n|€g }	n|g}	t        t        d|dd	i«      g|	¢­Ž 5  | j                   j                  || j!                  |«      «      }d d d «       |S # 1 sw Y   |S xY w)
NÚ_loginú?)ÚprocessÚlocationÚ	_callback)r   r   zcontent-typezapplication/json)ÚclientÚpostr   ÚproviderÚidr   Údictr   r   Úqueryr   Ú
isinstanceÚlistr
   r	   ÚgetÚget_complete_parameters)
r   Ú	resp_mockr   r   ÚrespÚpÚqÚcomplete_urlÚresponse_jsonÚ
resp_mockss
             r   ÚloginzNotionTests.loginB   s  € Ø�{‰{×ÑÜ�D—M‘M×$Ñ$ xÑ/Ó0Øñäœ WÔ-Ó.ñ/ó
ˆô �T˜*Ñ%Ó&ˆÜ�Q—W‘WÓˆä˜tŸ}™}×/Ñ/°+Ñ=Ó>ˆØ×4Ñ4Ø1ð 5ó 
ˆô �i¤Ô&Ø"‰JØÐØ‰Jà#˜ˆJäÜ˜3 °Ð@RÐ/SÓTð
àò
ñ 	Rð —;‘;—?‘? <°×1MÑ1MÈaÓ1PÓQˆD÷		Rð ˆ÷	Rð ˆús   Ã ,DÄD )F)Nr3   T)Ú__name__Ú
__module__Ú__qualname__r   r%   Úprovider_idÚpkce_enabled_defaultr   r   r   r3   r   r   r   r   r      s'   „ Ø ×#Ñ#€KØ Ðò
ò&)óô6r   r   N)Úurllib.parser   r   Údjango.testr   Údjango.urlsr   Údjango.utils.httpr   Úallauth.socialaccount.testsr   Úallauth.testsr	   r
   r$   r   r   r   r   r   ú<module>r?      s+   ðß +å  Ý Ý 'å 8ß 9å $ôQÐ" Hõ Qr   