From 3deaa392561055a49450747ed7cfb2a4e2183305 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Mon, 23 Jul 2018 13:21:57 +0200 Subject: [PATCH] [Test] Add test for disabled registration --- tests/test_register.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test_register.py b/tests/test_register.py index 2d10bdc..c276b63 100644 --- a/tests/test_register.py +++ b/tests/test_register.py @@ -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 -- 2.40.1