From 3f3a0ca3206ce472532991c064e47e6c4894ba7e Mon Sep 17 00:00:00 2001 From: Eemeli Ranta Date: Wed, 11 Dec 2024 19:33:17 +0200 Subject: [PATCH] Set `is_activated_on_begins` to `True` in tax update task --- tests/test_models/test_reservation_unit_pricing_updates.py | 4 +++- tilavarauspalvelu/tasks.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_models/test_reservation_unit_pricing_updates.py b/tests/test_models/test_reservation_unit_pricing_updates.py index 90e01c7c0..183ac1f48 100644 --- a/tests/test_models/test_reservation_unit_pricing_updates.py +++ b/tests/test_models/test_reservation_unit_pricing_updates.py @@ -35,7 +35,9 @@ def test_reservation_unit__update_pricings__tax_percentage__no_future_pricing(): future_pricings = ReservationUnitPricing.objects.filter(begins=TAX_CHANGE_DATE) assert future_pricings.count() == 1 # New pricing should be created for the change date - assert future_pricings.first().tax_percentage.value == FUTURE_TAX + future_pricing = future_pricings.first() + assert future_pricing.is_activated_on_begins is True + assert future_pricing.tax_percentage.value == FUTURE_TAX assert active_pricing.tax_percentage.value == CURRENT_TAX # Active pricing should not be changed assert SentryLogger.log_message.call_count == 1 diff --git a/tilavarauspalvelu/tasks.py b/tilavarauspalvelu/tasks.py index c452ea94d..060abfa01 100644 --- a/tilavarauspalvelu/tasks.py +++ b/tilavarauspalvelu/tasks.py @@ -317,6 +317,7 @@ def update_reservation_unit_pricings_tax_percentage( lowest_price=pricing.lowest_price, highest_price=pricing.highest_price, reservation_unit=pricing.reservation_unit, + is_activated_on_begins=True, ).save() # Log any unhandled future pricings