Add test for disabled registration #107

Merged
gergely merged 1 commits from test-coverage into master 2018-07-23 11:23:45 +00:00
1 changed files with 7 additions and 1 deletions

View File

@ -20,7 +20,7 @@
import calsocial
from calsocial.models import db, User
from helpers import client
from helpers import alter_config, client
def test_register_page(client):
@ -113,3 +113,9 @@ def test_register_existing_email(client):
'password_retype': 'password',
})
assert b'This email address can not be used' in page.data
def test_registration_disabled(client):
with alter_config(calsocial.app, REGISTRATION_ENABLED=False):
page = client.get('/accounts/register')
assert b'Registration is disabled' in page.data