Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Use caplog to check if the test is working
Ania Warzechac1900e6c5f8c
diff --git a/saleor/app/tests/test_app_tasks.py b/saleor/app/tests/test_app_tasks.pyindex 3a3352b2fc..7c2584166b 100644--- a/saleor/app/tests/test_app_tasks.py+++ b/saleor/app/tests/test_app_tasks.py@@ -1,4 +1,5 @@-from unittest.mock import Mock+import logging+from unittest.mock import ANY, Mockimport pytestfrom django.utils import timezone@@ -23,12 +24,20 @@ def test_install_app_task(app_installation):assert app.is_installed-def test_install_app_task_job_id_does_not_exist():+def test_install_app_task_job_id_does_not_exist(caplog):# given & whennonexistent_job_id = 5435435345install_app_task(nonexistent_job_id, activate=True)+ assert caplog.record_tuples == [+ (+ ANY,+ logging.WARNING,+ "Failed to install app. AppInstallation not found for job_id: "+ f"{nonexistent_job_id}.",+ )+ ]+# thenassert not App.objects.exists()@@ -62,7 +71,7 @@ def test_install_app_task_request_timeout(monkeypatch, app_installation):@pytest.mark.vcr-def test_install_app_task_wrong_response_code(monkeypatch):+def test_install_app_task_wrong_response_code():app_installation = AppInstallation.objects.create(app_name="External App",manifest_url="http://localhost:3000/manifest-wrong1",