mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 15:46:07 -05:00
Added a new rates table.
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.
This commit is contained in:
18
tests/app/dao/test_rates_dao.py
Normal file
18
tests/app/dao/test_rates_dao.py
Normal file
@@ -0,0 +1,18 @@
|
||||
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
|
||||
Reference in New Issue
Block a user