Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set is_activated_on_begins to True in tax update task #1466

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading