Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Fix failing import-path for promotion schedule (#16915)
Maciej Korycinskife6e46266e81
diff --git a/saleor/core/schedules.py b/saleor/core/schedules.pyindex 674b943afc..2b1072bbe8 100644--- a/saleor/core/schedules.py+++ b/saleor/core/schedules.py@@ -37,7 +37,7 @@ class promotion_webhook_schedule(CustomSchedule):schedule=self,nowfun=nowfun,app=app,- import_path="saleor.core.schedules.promotion_webhook_schedule",+ import_path="saleor.core.schedules.initiated_promotion_webhook_schedule",)# Seconds left to next batch processingself.NEXT_BATCH_RUN_TIME = 5diff --git a/saleor/core/tests/test_schedules.py b/saleor/core/tests/test_schedules.pyindex 9b24a313d8..2babca0db7 100644--- a/saleor/core/tests/test_schedules.py+++ b/saleor/core/tests/test_schedules.py@@ -1,6 +1,8 @@import datetime+from celery.schedules import BaseSchedulefrom django.utils import timezone+from django.utils.module_loading import import_stringfrom freezegun import freeze_timefrom ...discount.models import Promotion@@ -213,3 +215,14 @@ def test_is_due_no_promo_to_notify_about_upcoming_promo_exists_initial_time_retu# thenassert is_due is Falseassert next_run == schedule.initial_timedelta.total_seconds()+++def test_promotion_webhook_schedule_import_path():+ # given+ schedule = promotion_webhook_schedule()++ # when+ scheduler_instance = import_string(schedule.import_path)++ # then+ assert isinstance(scheduler_instance, BaseSchedule)