mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
Add a new table to store the api information for a service inbound sms message.
Including: - url to push the inbound sms to - bearer_token to be added to the header of the request. The services will be expected to manage these properties.
This commit is contained in:
20
tests/app/dao/test_save_service_inbound_api.py
Normal file
20
tests/app/dao/test_save_service_inbound_api.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from app.dao.service_inbound_api_dao import save_service_inbound_api
|
||||
from app.models import ServiceInboundApi
|
||||
|
||||
|
||||
def test_save_service_inbound_api(sample_service):
|
||||
service_inbound_api = ServiceInboundApi(
|
||||
service_id=sample_service.id,
|
||||
url="https::/some_service/inbound_messages",
|
||||
bearer_token="some_unique_string"
|
||||
)
|
||||
|
||||
save_service_inbound_api(service_inbound_api)
|
||||
|
||||
results = ServiceInboundApi.query.all()
|
||||
assert len(results) == 1
|
||||
assert results[0].id
|
||||
assert results[0].service_id == sample_service.id
|
||||
assert results[0].url == "https::/some_service/inbound_messages"
|
||||
assert results[0].unsigned_bearer_token == "some_unique_string"
|
||||
assert results[0].bearer_token != "some_unique_string"
|
||||
Reference in New Issue
Block a user