Skip to content

Commit

Permalink
Set is_activated_on_begins to True in tax update task
Browse files Browse the repository at this point in the history
  • Loading branch information
ranta committed Dec 12, 2024
1 parent a993056 commit 3f3a0ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_models/test_reservation_unit_pricing_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tilavarauspalvelu/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3f3a0ca

Please sign in to comment.