Adding tests for verify_emails and user_can_view_challenges are set (#462)

* Fixing verify_emails + user_can_view_challenges logic
* Adding tests for verify_emails and user_can_view_challenges
This commit is contained in:
Kevin Chung
2017-11-15 03:33:50 -05:00
committed by GitHub
parent ab2de6cf17
commit 0b0305f969
3 changed files with 121 additions and 5 deletions

View File

@@ -91,9 +91,10 @@ def test_user_isnt_admin():
with app.app_context():
register_user(app)
client = login_as_user(app)
r = client.get('/admin/graphs')
assert r.location == "http://localhost/login"
assert r.status_code == 302
for page in ['graphs', 'pages', 'teams', 'scoreboard', 'chals', 'statistics', 'config']:
r = client.get('/admin/{}'.format(page))
assert r.location == "http://localhost/login"
assert r.status_code == 302
destroy_ctfd(app)