mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-16 20:48:37 -04:00
We only need one rate per channel. This reflects that. The provider_rates has been left for now, it is still not being used. New dao has been added to select the right rate for the given notification_type and date of notificaiton.
19 lines
527 B
Python
19 lines
527 B
Python
from datetime import datetime
|
|
|
|
from decimal import Decimal
|
|
|
|
from app.dao.rates_dao import get_rate_for_type_and_date
|
|
|
|
|
|
def test_get_rate_for_type_and_date(notify_db):
|
|
rate = get_rate_for_type_and_date('sms', datetime.utcnow())
|
|
assert rate.rate == Decimal("1.58")
|
|
|
|
rate = get_rate_for_type_and_date('sms', datetime(2016, 6, 1))
|
|
assert rate.rate == Decimal("1.65")
|
|
|
|
|
|
def test_get_rate_for_type_and_date_early_date(notify_db):
|
|
rate = get_rate_for_type_and_date('sms', datetime(2014, 6, 1))
|
|
assert not rate
|