mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-02 17:48:50 -04:00
Updated from git comments. Return status code 400 for duplicate
email address.
This commit is contained in:
@@ -35,6 +35,7 @@ def register():
|
|||||||
return redirect(url_for('main.verify'))
|
return redirect(url_for('main.verify'))
|
||||||
else:
|
else:
|
||||||
flash('There was an error registering your account')
|
flash('There was an error registering your account')
|
||||||
|
return render_template('views/register.html', form=form), 400
|
||||||
|
|
||||||
return render_template('views/register.html', form=form)
|
return render_template('views/register.html', form=form)
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ def test_register_with_existing_email_returns_error(app_,
|
|||||||
with app_.test_request_context():
|
with app_.test_request_context():
|
||||||
response = app_.test_client().post(url_for('main.register'),
|
response = app_.test_client().post(url_for('main.register'),
|
||||||
data=user_data)
|
data=user_data)
|
||||||
assert response.status_code == 200
|
assert response.status_code == 400
|
||||||
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
||||||
element = page.find('h1')
|
element = page.find('h1')
|
||||||
assert element.text == 'Create an account'
|
assert element.text == 'Create an account'
|
||||||
|
|||||||
Reference in New Issue
Block a user