Add test for disabled registration #107
@ -20,7 +20,7 @@
|
|||||||
import calsocial
|
import calsocial
|
||||||
from calsocial.models import db, User
|
from calsocial.models import db, User
|
||||||
|
|
||||||
from helpers import client
|
from helpers import alter_config, client
|
||||||
|
|
||||||
|
|
||||||
def test_register_page(client):
|
def test_register_page(client):
|
||||||
@ -113,3 +113,9 @@ def test_register_existing_email(client):
|
|||||||
'password_retype': 'password',
|
'password_retype': 'password',
|
||||||
})
|
})
|
||||||
assert b'This email address can not be used' in page.data
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user