From 0fea95a6f4fd8719725083b3b00c17bfd0cc9458 Mon Sep 17 00:00:00 2001 From: Bojan Mihelac Date: Mon, 29 Jul 2024 10:37:30 +0200 Subject: [PATCH] Check last log message instead of first one in FilesTest tests --- easy_thumbnails/tests/test_files.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/easy_thumbnails/tests/test_files.py b/easy_thumbnails/tests/test_files.py index ee9c901..b88a8ae 100644 --- a/easy_thumbnails/tests/test_files.py +++ b/easy_thumbnails/tests/test_files.py @@ -211,7 +211,6 @@ def test_default_subsampling(self): @unittest.skipIf( 'easy_thumbnails.optimize' not in settings.INSTALLED_APPS, 'optimize app not installed') - @unittest.skipIf(LogCapture is None, 'testfixtures not installed') def test_postprocessor(self): """use a mock image optimizing post processor doing nothing""" settings.THUMBNAIL_OPTIMIZE_COMMAND = { @@ -219,7 +218,7 @@ def test_postprocessor(self): with LogCapture() as logcap: self.ext_thumbnailer.thumbnail_extension = 'png' self.ext_thumbnailer.get_thumbnail({'size': (10, 10)}) - actual = tuple(logcap.actual())[0] + actual = tuple(logcap.actual())[-1] self.assertEqual(actual[0], 'easy_thumbnails.optimize') self.assertEqual(actual[1], 'INFO') self.assertRegex( @@ -237,7 +236,7 @@ def test_postprocessor_fail(self): with LogCapture() as logcap: self.ext_thumbnailer.thumbnail_extension = 'png' self.ext_thumbnailer.get_thumbnail({'size': (10, 10)}) - actual = tuple(logcap.actual())[0] + actual = tuple(logcap.actual())[-1] self.assertEqual(actual[0], 'easy_thumbnails.optimize') self.assertEqual(actual[1], 'ERROR') self.assertRegex(