Add a new banner for telling you about trial mode

We’ve found in research that developers have no idea they’re in trial
mode until they hit an error. And even then they don’t really know what
trial mode means.

So this commit:
- adds a message to the API integration page about trial mode
- puts it in a really yellow banner to draw attention to it
- adds the same banner to the settings page
This commit is contained in:
Chris Hill-Scott
2016-09-20 12:12:58 +01:00
parent f514d377f7
commit 4a596c1dd2
4 changed files with 70 additions and 19 deletions

View File

@@ -19,6 +19,21 @@ def test_should_show_api_page(
assert response.status_code == 200
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
assert page.h1.string.strip() == 'API integration'
assert 'Your service is in trial mode' in page.find('div', {'class': 'banner-warning'}).text
def test_should_show_api_page_for_live_service(
app_,
mock_login,
api_user_active,
mock_get_live_service,
mock_has_permissions
):
with app_.test_request_context(), app_.test_client() as client:
client.login(api_user_active)
response = client.get(url_for('main.api_integration', service_id=str(uuid.uuid4())))
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
assert 'Your service is in trial mode' not in page.find('main').text
def test_should_show_api_documentation_page(