Skip to content

Commit

Permalink
Correcting rounding strategy (#5373)
Browse files Browse the repository at this point in the history
  • Loading branch information
whitdog47 authored Oct 22, 2024
1 parent 70b554a commit db2d04d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/incident_cost/test_incident_cost_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def test_calculate_incident_response_cost_with_cost_model(
):
"""Tests that the incident cost is calculated correctly when a cost model is enabled."""
from datetime import timedelta
from decimal import Decimal, ROUND_UP
from decimal import Decimal, ROUND_HALF_UP
from dispatch.incident_cost.service import update_incident_response_cost, get_hourly_rate
from dispatch.incident_cost_type import service as incident_cost_type_service
from dispatch.participant_activity.service import (
Expand Down Expand Up @@ -154,8 +154,8 @@ def test_calculate_incident_response_cost_with_cost_model(
) * hourly_rate + orig_total_incident_cost

assert cost
assert cost == Decimal(expected_incident_cost).quantize(cost, rounding=ROUND_UP)
assert cost == Decimal(incident.total_cost).quantize(cost, rounding=ROUND_UP)
assert cost == Decimal(expected_incident_cost).quantize(cost, rounding=ROUND_HALF_UP)
assert cost == Decimal(incident.total_cost).quantize(cost, rounding=ROUND_HALF_UP)


def test_calculate_incident_response_cost_with_cost_model__no_enabled_plugins(
Expand Down

0 comments on commit db2d04d

Please sign in to comment.