View to show all inbound sms numbers for the platform admin user.

This commit is contained in:
Rebecca Law
2017-08-15 17:04:57 +01:00
parent 27a9180d2a
commit 8aab08d4d2
6 changed files with 54 additions and 22 deletions

View File

@@ -0,0 +1,34 @@
from bs4 import BeautifulSoup
from flask import url_for
sample_inbound_sms = {'data': [{"id": "activated",
"number": "0784121212",
"provider": "provider_one",
"service": {"id": "123234", "name": "Service One"},
"active": True,
"created_at": "2017-08-15T13:30:30.12312",
"updated_at": "2017-08-15T13:30:30.12312"},
{"id": "available",
"number": "0784131313",
"provider": "provider_one",
"service": None,
"active": True,
"created_at": "2017-08-15T13:30:30.12312",
"updated_at": None},
{"id": "deactivated",
"number": "0784131313",
"provider": "provider_one",
"service": None,
"active": True,
"created_at": "2017-08-15T13:30:30.12312",
"updated_at": None}
]}
def test_inbound_sms_admin(logged_in_platform_admin_client, mocker):
mocker.patch("app.inbound_number_client.get_all_inbound_sms_number_service", return_value=sample_inbound_sms)
response = logged_in_platform_admin_client.get(url_for("main.inbound_sms_admin"))
assert response.status_code == 200
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
assert page.h1.string.strip() == "Inbound SMS"