Ë
    T]jL  ã                   óZ   — d Z ddlmZ ddlmZmZ ddlmZ  G d„ dej                  «      Z	y)zTests for the models module.
é    )Úutils)Ú	ThumbnailÚSourcec                   ó>   ‡ — e Zd ZdZˆ fd„Zˆ fd„Zd„ Zd„ Zd„ Zˆ xZ	S )ÚFileManagerTestzTest for FileManagerc                 ó>  •— t         ‰| �  «        t        j                  «       | _        t        j                  | j                  «      | _        t        j                  j                  d| j                  ¬«      | _        | j                  | j                  d«      | _        y )NzTest source)ÚnameÚstorage_hashztest.jpg)ÚsuperÚsetUpÚtestÚTemporaryStorageÚstorager   Úget_storage_hashr
   r   ÚobjectsÚcreateÚsourceÚcreate_imageÚfilename©ÚselfÚ	__class__s    €úX/var/www/zogu/zoguvenv/lib/python3.12/site-packages/easy_thumbnails/tests/test_models.pyr   zFileManagerTest.setUp   st   ø€ Ü‰‰Œä×,Ñ,Ó.ˆŒÜ!×2Ñ2°4·<±<Ó@ˆÔÜ—n‘n×+Ñ+ØØ×*Ñ*ð ,ó ,ˆŒð
 ×)Ñ)¨$¯,©,¸
ÓCˆ�ó    c                 óV   •— | j                   j                  «        t        ‰| �  «        y )N)r   Údelete_temporary_storager   ÚtearDownr   s    €r   r   zFileManagerTest.tearDown   s   ø€ Ø�‰×-Ñ-Ô/Ü‰ÑÕr   c                 óÒ   — t         j                  j                  | j                  | j                  d| j
                  ¬«      }| j                  |j                  | j                  «       y)z&Create a new Thumbnail in the databaseT)r   r   N)r   r   Úget_filer   r   r   ÚassertEqualr	   )r   Úimgs     r   Útest_create_filez FileManagerTest.test_create_file   sO   € ä×Ñ×(Ñ(Ø�L‰LØ�M‰MØØ—;‘;ð	 )ó  ˆð 	×Ñ˜Ÿ™ 4§=¡=Õ1r   c                 ó6  — t         j                  j                  | j                  | j                  | j
                  ¬«      }t         j                  j                  | j                  | j                  d¬«      }| j                  |«       | j                  ||«       y)z%Fetch an existing thumb from database)r
   r	   r   F)r   N)
r   r   r   r
   r   r   r   r   Ú
assertTruer    )r   ÚcreatedÚfetcheds      r   Útest_get_filezFileManagerTest.test_get_file&   s€   € ä×#Ñ#×*Ñ*Ø×*Ñ*Ø—‘Ø—;‘;ð +ó  ˆô
 ×#Ñ#×,Ñ,Ø�L‰LØ�M‰MØð -ó ˆð
 	�‰˜Ô Ø×Ñ˜ 'Õ*r   c                 óÚ  — 	 t         j                  j                  | j                  ¬«       | j	                  d«       t         j                  j                  | j                  | j                  | j                  d¬«       	 t         j                  j                  | j                  ¬«       y# t         j
                  $ r Y Œ‚w xY w# t         j
                  $ r | j	                  d«       Y yw xY w)z<Fetch a thumb that is in the storage but not in the database)r	   zThumb should not exist yetT)r   Úcheck_cache_misszThumb should exist nowN)	r   r   Úgetr   ÚfailÚDoesNotExistr   r   r   )r   s    r   Útest_get_file_check_cachez)FileManagerTest.test_get_file_check_cache5   s¿   € ð	Ü×Ñ×!Ñ! t§}¡}Ð!Ô5Ø�I‰IÐ2Ô3ô 	×Ñ×"Ñ"Ø�L‰LØ�M‰MØ—;‘;Ø!ð	 	#ô 	#ð	0Ü×Ñ×!Ñ! t§}¡}Ð!Õ5øô ×%Ñ%ò 	Ùð	ûô ×%Ñ%ò 	0Ø�I‰IÐ.Ö/ð	0ús#   ‚;B* Á?*C Â*C Â?C Ã$C*Ã)C*)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r"   r'   r-   Ú__classcell__)r   s   @r   r   r   	   s    ø„ Ùô
Dôò2ò+ö0r   r   N)
r1   Úeasy_thumbnailsr   Úeasy_thumbnails.modelsr   r   Úeasy_thumbnails.testsr   ÚBaseTestr   © r   r   ú<module>r8      s'   ðñõ "ß 4Ý /ô@0�d—m‘mõ @0r   