[Test] Add test for disabled registration

This commit is contained in:
Gergely Polonkai 2018-07-23 13:21:57 +02:00
parent c20b302458
commit 3deaa39256

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