From e6bcca7a207b9273c49d8d6901c207c18165ff8b Mon Sep 17 00:00:00 2001 From: anishTP Date: Tue, 7 Nov 2023 18:46:12 +0530 Subject: [PATCH] Unit test for preview_image function WIP --- tests/unit/views/preview_image_test.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/unit/views/preview_image_test.py diff --git a/tests/unit/views/preview_image_test.py b/tests/unit/views/preview_image_test.py new file mode 100644 index 000000000..c7b3436ab --- /dev/null +++ b/tests/unit/views/preview_image_test.py @@ -0,0 +1,16 @@ +import pytest + +from funnel.views.thumbnails import render_project_preview_image + +@pytest.mark.usefixtures('app_context') +@pytest.fixture() +def add_tasks_to_queue(project): + render_project_preview_image.queue(project_id=project.id, job_id=project.id) + +@pytest.mark.usefixtures('add_tasks_to_queue', 'project_expo2011', 'project_ai1', + 'project_ai2') +def test_preview_image_jobs(): + add_tasks_to_queue(project_expo2011) + add_tasks_to_queue(project_ai1) + add_tasks_to_queue(project_ai2) + pass