o
    E6÷dm  ć                   @   sv   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 ddl mZ ddl m	Z	 dd	l m
Z
 G d
d dejZdS )é   )Śfixtures)Śeq_)ŚColumn)ŚTableé   )ŚInteger)Śselect)Śtesting)Śunionc                   @   sz   e Zd ZdZedd Zedd ZdddZd	d
 Zdd Z	e
jje
jjdd Ze
jjdd Zdd Zdd ZdS )ŚDeprecatedCompoundSelectTestTc                 C   s*   t d|tdtddtdttdt d S )NŚ
some_tableŚidT)Zprimary_keyŚxŚy)r   r   r   )ŚclsŚmetadata© r   śC:\Users\jesus\OneDrive\Desktop\erpjis_fastapi\backend\jisbackend\Lib\site-packages\sqlalchemy/testing/suite/test_deprecations.pyŚdefine_tables   s   ūz*DeprecatedCompoundSelectTest.define_tablesc              
   C   s@   |  | jj ” ddddddddddddddddg” d S )Né   r   )r   r   r   r   é   é   )ŚexecuteŚtablesr   Śinsert)r   Ś
connectionr   r   r   Śinsert_data   s   




üžz(DeprecatedCompoundSelectTest.insert_datar   c                 C   s   t | ||” ” | d S )N)r   r   Zfetchall)ŚselfŚconnr   ŚresultŚparamsr   r   r   Ś_assert_result&   s   z+DeprecatedCompoundSelectTest._assert_resultc                 C   s   | j j}t| |jjdk”}t| |jjdk”}t||}t d” |  	|| 
|jj”ddg” W d    d S 1 s>w   Y  d S ©Nr   r   śAThe SelectBase.c and SelectBase.columns attributes are deprecated©r   r   r   ©r   r   r   )r   r   r   ŚwhereŚcr   r
   r	   Śexpect_deprecatedr!   Śorder_by©r   r   ŚtableŚs1Śs2Śu1r   r   r   Śtest_plain_union)   s   
’’"üz-DeprecatedCompoundSelectTest.test_plain_unionc                 C   s   | j j}t| |jjdk”}t| |jjdk”}t|| ”  ” }t 	d” |  
|| |jj”ddg” W d    d S 1 sBw   Y  d S r"   )r   r   r   r&   r'   r   r
   Śaliasr	   r(   r!   r)   r*   r   r   r   Ś"_dont_test_select_from_plain_union>   s   ’’"üz?DeprecatedCompoundSelectTest._dont_test_select_from_plain_unionc                 C   s°   | j j}t| |jjdk” d” |jj”}t| |jjdk” d” |jj”}t|| d”}t	 
d” |  || |jj”ddg” W d    d S 1 sQw   Y  d S ©Nr   r   r   r#   r$   r%   )r   r   r   r&   r'   r   Ślimitr)   r
   r	   r(   r!   r*   r   r   r   Ś&test_limit_offset_selectable_in_unionsL   s   &&’’"üzCDeprecatedCompoundSelectTest.test_limit_offset_selectable_in_unionsc                 C   s¤   | j j}t| |jjdk” |jj”}t| |jjdk” |jj”}t|| d”}t	 
d” |  || |jj”ddg” W d    d S 1 sKw   Y  d S r"   )r   r   r   r&   r'   r   r)   r
   r3   r	   r(   r!   r*   r   r   r   Ś"test_order_by_selectable_in_unions\   s     ’’"üz?DeprecatedCompoundSelectTest.test_order_by_selectable_in_unionsc                 C   s   | j j}t| |jjdk” ” }t| |jjdk” ” }t|| d”}t	 
d” |  || |jj”ddg” W d    d S 1 sEw   Y  d S r"   )r   r   r   r&   r'   r   Zdistinctr
   r3   r	   r(   r!   r)   r*   r   r   r   Ś"test_distinct_selectable_in_unionsk   s   ’’"üz?DeprecatedCompoundSelectTest.test_distinct_selectable_in_unionsc                 C   sĄ   | j j}t| |jjdk” d” |jj” ”  ” }t| |jjdk” d” |jj” ”  ” }t	|| d”}t
 d” |  || |jj”ddg” W d    d S 1 sYw   Y  d S r2   )r   r   r   r&   r'   r   r3   r)   r0   r
   r	   r(   r!   r*   r   r   r   Ś.test_limit_offset_aliased_selectable_in_unionsy   s.   
ś	
ś	’’"üzKDeprecatedCompoundSelectTest.test_limit_offset_aliased_selectable_in_unionsN)r   )Ś__name__Ś
__module__Ś__qualname__Z__backend__Śclassmethodr   r   r!   r/   r1   r	   ŚrequiresZorder_by_col_from_unionZ/parens_in_union_contained_select_w_limit_offsetr4   Z0parens_in_union_contained_select_wo_limit_offsetr5   r6   r7   r   r   r   r   r      s     
	


r   N)Ś r   Z
assertionsr   Zschemar   r   r   r   r	   r
   Z
TablesTestr   r   r   r   r   Ś<module>   s   