From 3a91926e189adf68fa095e04c00ef6caa80a22a8 Mon Sep 17 00:00:00 2001 From: James Meakin <12661555+jmsmkn@users.noreply.github.com> Date: Thu, 13 May 2021 10:48:38 +0200 Subject: [PATCH] Add failing test for multiple jpeg conversion --- tests/test_models.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_models.py b/tests/test_models.py index 516f6a3..772737d 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -270,3 +270,13 @@ def test_convert(self, db): assert obj.image.thumbnail.path.endswith("img/100.thumbnail.jpeg") assert obj.image.full.width == 100 assert obj.image.full.height == 100 + + def test_convert_multiple(self, db): + large = models.JPEGModel.objects.create(image=self.fixtures["600x400.gif"]) + small = models.JPEGModel.objects.create(image=self.fixtures["100.gif"]) + + assert large.image.field._variations["full"] == (None, None) + assert small.image.field._variations["full"] == (None, None) + + assert large.image.full.width == 600 + assert small.image.full.width == 100