Simple bugfix merges (#1531)

* Closes #1530 
* Clean up some wording and comments
* Pin isort version to fix flake8 issue (https://github.com/gforcada/flake8-isort/issues/88)
This commit is contained in:
Kevin Chung
2020-07-06 15:34:55 -04:00
committed by GitHub
parent adc70fb320
commit 7dcfba40b3
10 changed files with 32 additions and 6 deletions

View File

@@ -244,6 +244,21 @@ def test_api_challenge_get_visibility_private():
destroy_ctfd(app)
def test_api_challenge_get_with_admin_only_account_visibility():
"""Can a private user get /api/v1/challenges/<challenge_id> if account_visibility is admins_only"""
app = create_ctfd()
with app.app_context():
gen_challenge(app.db)
register_user(app)
client = login_as_user(app)
r = client.get("/api/v1/challenges/1")
assert r.status_code == 200
set_config("account_visibility", "admins")
r = client.get("/api/v1/challenges/1")
assert r.status_code == 200
destroy_ctfd(app)
def test_api_challenge_get_ctftime_private():
"""Can a private user get /api/v1/challenges/<challenge_id> if ctftime is over"""
app = create_ctfd()