mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
combine post + get inbound, and make them respect data retention
also removed the limit/limit_days args as they're not used by admin
This commit is contained in:
@@ -62,7 +62,7 @@ def test_get_all_inbound_sms_filters_on_time(sample_service, notify_db_session):
|
||||
sms_two = create_inbound_sms(sample_service, created_at=datetime(2017, 8, 6, 23, 0)) # monday (7th) morning
|
||||
|
||||
with freeze_time('2017-08-14 12:00'):
|
||||
res = dao_get_inbound_sms_for_service(sample_service.id)
|
||||
res = dao_get_inbound_sms_for_service(sample_service.id, limit_days=7)
|
||||
|
||||
assert len(res) == 1
|
||||
assert res[0] == sms_two
|
||||
@@ -118,13 +118,13 @@ def test_should_delete_inbound_sms_according_to_data_retention(notify_db_session
|
||||
# four deleted for the 3-day service, two for the default seven days one, one for the 30 day
|
||||
assert deleted_count == 7
|
||||
assert {
|
||||
x.created_at for x in dao_get_inbound_sms_for_service(short_retention_service.id, limit_days=None)
|
||||
x.created_at for x in dao_get_inbound_sms_for_service(short_retention_service.id)
|
||||
} == set(dates[:1])
|
||||
assert {
|
||||
x.created_at for x in dao_get_inbound_sms_for_service(no_retention_service.id, limit_days=None)
|
||||
x.created_at for x in dao_get_inbound_sms_for_service(no_retention_service.id)
|
||||
} == set(dates[:3])
|
||||
assert {
|
||||
x.created_at for x in dao_get_inbound_sms_for_service(long_retention_service.id, limit_days=None)
|
||||
x.created_at for x in dao_get_inbound_sms_for_service(long_retention_service.id)
|
||||
} == set(dates[:4])
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user