This commit is contained in:
venusbb
2017-12-11 11:44:29 +00:00
4 changed files with 13 additions and 4 deletions

View File

@@ -30,6 +30,9 @@ def sign_in():
return redirect(url_for('main.choose_service'))
form = LoginForm()
if form.email_address.data:
form.email_address.data = form.email_address.data.strip()
if form.validate_on_submit():
user = user_api_client.get_user_by_email_or_none(form.email_address.data)

View File

@@ -120,12 +120,12 @@
<div class="grid-row bottom-gutter">
<div class="column-half">
<h3 class="visually-hidden">Services</h3>
<div class="product-page-big-number">117</div>
<div class="product-page-big-number">119</div>
services
</div>
<div class="column-half">
<h3 class="visually-hidden">Organisations</h3>
<div class="product-page-big-number">50</div>
<div class="product-page-big-number">51</div>
organisations
</div>
</div>

View File

@@ -7,7 +7,7 @@ boto3==1.4.8
blinker==1.4
pyexcel==0.5.6
pyexcel-io==0.5.4
pyexcel-xls==0.5.4
pyexcel-xls==0.5.5
pyexcel-xlsx==0.5.4
pyexcel-ods3==0.5.2
pytz==2017.3

View File

@@ -77,6 +77,10 @@ def test_logged_in_user_redirects_to_choose_service(
assert response.location == url_for('main.choose_service', _external=True)
@pytest.mark.parametrize('email_address', [
'valid@example.gov.uk',
' valid@example.gov.uk ',
])
def test_process_sms_auth_sign_in_return_2fa_template(
client,
api_user_active,
@@ -84,14 +88,16 @@ def test_process_sms_auth_sign_in_return_2fa_template(
mock_get_user,
mock_get_user_by_email,
mock_verify_password,
email_address,
):
response = client.post(
url_for('main.sign_in'), data={
'email_address': 'valid@example.gov.uk',
'email_address': email_address,
'password': 'val1dPassw0rd!'})
assert response.status_code == 302
assert response.location == url_for('.two_factor', _external=True)
mock_verify_password.assert_called_with(api_user_active.id, 'val1dPassw0rd!')
mock_get_user_by_email.assert_called_with('valid@example.gov.uk')
def test_process_email_auth_sign_in_return_2fa_template(