mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 06:21:50 -05:00
Refactor:
* Filter inbound by service_id * Refactor to return 404 instead of 400 for consistency
This commit is contained in:
@@ -92,6 +92,6 @@ def test_should_not_delete_inbound_sms_before_seven_days(sample_service):
|
||||
def test_get_inbound_sms_by_id_returns(sample_service):
|
||||
inbound = create_inbound_sms(sample_service)
|
||||
|
||||
inbound_from_db = dao_get_inbound_sms_by_id(inbound.id)
|
||||
inbound_from_db = dao_get_inbound_sms_by_id(sample_service.id, inbound.id)
|
||||
|
||||
assert inbound == inbound_from_db
|
||||
|
||||
@@ -129,12 +129,23 @@ def test_get_inbound_sms_by_id_returns_200(admin_request, sample_service):
|
||||
assert response['service_id'] == str(sample_service.id)
|
||||
|
||||
|
||||
def test_get_inbound_sms_by_id_invalid_id_returns_400(admin_request, sample_service):
|
||||
def test_get_inbound_sms_by_id_invalid_id_returns_404(admin_request, sample_service):
|
||||
assert admin_request.get(
|
||||
'inbound_sms.get_inbound_by_id',
|
||||
endpoint_kwargs={
|
||||
'service_id': sample_service.id,
|
||||
'inbound_sms_id': 'dsadsda'
|
||||
'inbound_sms_id': 'bar'
|
||||
},
|
||||
expected_status=400
|
||||
expected_status=404
|
||||
)
|
||||
|
||||
|
||||
def test_get_inbound_sms_by_id_with_invalid_service_id_returns_404(admin_request, sample_service):
|
||||
assert admin_request.get(
|
||||
'inbound_sms.get_inbound_by_id',
|
||||
endpoint_kwargs={
|
||||
'service_id': 'foo',
|
||||
'inbound_sms_id': '2cfbd6a1-1575-4664-8969-f27be0ea40d9'
|
||||
},
|
||||
expected_status=404
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user