-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ce2323
commit 9e609b1
Showing
3 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -174,6 +174,27 @@ def test_registration_view(api): | |
assert res.status_code == 200 | ||
|
||
|
||
def test_custom_registration_view(app_with_flexible_registration): | ||
app = app_with_flexible_registration | ||
with app.app_context(): | ||
create_test_user(email='[email protected]') | ||
db.session.commit() | ||
with app.test_client() as client: | ||
url = url_for('invenio_accounts_rest_auth.register') | ||
|
||
# Missing custom field | ||
res = client.post(url, data=dict( | ||
email='[email protected]', password='123456')) | ||
assert_error_resp(res, ( | ||
('active', 'required'), | ||
)) | ||
|
||
# Successful registration | ||
res = client.post(url, data=dict( | ||
email='[email protected]', password='123456', active=True)) | ||
assert res.status_code == 200 | ||
|
||
|
||
def test_logout_view(api): | ||
app = api | ||
with app.app_context(): | ||
|