o
    h	                     @   sL   d dl mZ d dlmZ d dlmZmZ ddlmZm	Z	 G dd deZ
dS )	    )TestCase)Filter)get_rendition_or_not_foundget_renditions_or_not_found   )Imageget_test_image_filec                   @   s*   e Zd ZdgZdd Zdd Zdd ZdS )	TestShortcutsz	test.jsonc                 C   sV   t jjdd}t jjdt d}t|d}| |jd t|d}| |jj	d d S )Nr   id
Test imagetitlefile	width-400  	not-found)
r   objectsgetcreater   r   assertEqualwidthr   name)self	bad_image
good_image	rendition r   c/var/www/html/ndineBlogger/venv/lib/python3.10/site-packages/wagtail/images/tests/test_shortcuts.pytest_fallback_to_not_found   s   

z(TestShortcuts.test_fallback_to_not_foundc                 C   s   t jjdd}t jjdt d}t|d}| t| d | |d j	d | |d j	d	 t|d}| t| d | |d j
jd
 | |d j
jd
 d S )Nr   r
   r   r   	width-200r   r!      r   r   r   )r   r   r   r   r   r   r   tuplekeysr   r   r   r   r   r   
renditionsr   r   r   #test_multiple_fallback_to_not_found   s   

z1TestShortcuts.test_multiple_fallback_to_not_foundc                 C   s   t jjdd}t jjdt d}t|tdtdf}| t|	 d | |d j
d | |d j
d	 t|tdtdf}| t|	 d | |d jjd
 | |d jjd
 d S )Nr   r
   r   r   r!   r   r    r"   r   r   )r   r   r   r   r   r   r   r   r#   r$   r   r   r   r%   r   r   r   0test_multiple_fallback_to_not_found_with_filters-   s"   z>TestShortcuts.test_multiple_fallback_to_not_found_with_filtersN)__name__
__module____qualname__fixturesr   r'   r(   r   r   r   r   r	      s
    r	   N)django.testr   wagtail.images.modelsr   wagtail.images.shortcutsr   r   utilsr   r   r	   r   r   r   r   <module>   s
    