Skip to content

Commit

Permalink
Add srcset tests
Browse files Browse the repository at this point in the history
  • Loading branch information
autoantwort committed Jul 8, 2024
1 parent 02d60e2 commit 5811279
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_thumbnail_tag.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
import re
from django.template import TemplateSyntaxError

from . import imagegenerators # noqa
Expand Down Expand Up @@ -87,3 +88,11 @@ def test_alternate_generator():
clear_imagekit_cache()
html = render_tag(ttag)
assert html == '1'


def test_srcset_arg():
ttag = r"""{% thumbnail '100x' img srcset="1.5 2" %}"""
clear_imagekit_cache()
html = render_tag(ttag)
srcset_regex = re.compile('srcset=".* 1x ,.* 1\\.5x ,.* 2.0x"')
assert srcset_regex.search(html) is not None

0 comments on commit 5811279

Please sign in to comment.