Remove register URL | Closes #2
This commit is contained in:
parent
ed71714a79
commit
67953ac42e
6 changed files with 10 additions and 4 deletions
|
|
@ -15,6 +15,7 @@ def app():
|
|||
app = create_app({
|
||||
'TESTING': True,
|
||||
'DATABASE': db_path,
|
||||
'ALLOW_REGISTER': True,
|
||||
})
|
||||
|
||||
with app.app_context():
|
||||
|
|
|
|||
|
|
@ -14,6 +14,10 @@ def test_register(client, app):
|
|||
"SELECT * FROM user WHERE USERNAME = 'a'",
|
||||
).fetchone() is not None
|
||||
|
||||
app.config["ALLOW_REGISTER"] = False
|
||||
response = client.get('/auth/register')
|
||||
assert b"Admin only" in response.data
|
||||
|
||||
@pytest.mark.parametrize(('username', 'password', 'message'), (
|
||||
('', '', b'Username is required.'),
|
||||
('a', '', b'Password is required.'),
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from flaskr.db import get_db
|
|||
def test_index(client, auth):
|
||||
response = client.get('/')
|
||||
assert b"Log In" in response.data
|
||||
assert b"Register" in response.data
|
||||
assert b"Register" not in response.data
|
||||
|
||||
auth.login()
|
||||
response = client.get('/')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue