Fixing issues with loading /chals when unregistered (#388)

This commit is contained in:
Kevin Chung
2017-09-13 12:01:09 -04:00
committed by GitHub
parent 3a8a7e5dd0
commit c97e7c6edc
3 changed files with 44 additions and 4 deletions

View File

@@ -194,7 +194,9 @@ def test_ctftime_prevents_accessing_challenges_before_ctf():
"nonce": sess.get('nonce')
}
r = client.post('/chal/{}'.format(chal_id), data=data)
assert r.status_code == 403
data = r.get_data(as_text=True)
data = json.loads(data)
assert data['status'] == -1
solve_count = app.db.session.query(app.db.func.count(Solves.id)).first()[0]
assert solve_count == 0
destroy_ctfd(app)