Fix broken tests

This commit is contained in:
Kevin Chung
2020-06-03 13:25:30 -04:00
parent 454845a234
commit 126f4a91e4
9 changed files with 51 additions and 46 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -13,7 +13,7 @@
<script type="text/javascript">
var init = {
'urlRoot': "{{ request.script_root }}",
'csrfNonce': "{{ nonce }}",
'csrfNonce': "{{ Session.nonce }}",
'userMode': "{{ get_config('user_mode') }}",
'userId': {{ id if (id is defined) else 0 }},
'start': {{ get_config("start") | tojson }},

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -15,7 +15,11 @@
</div>
<div class="container">
{% include "components/errors.html" %}
<div class="row">
<div class="col-md-12">
{% include "components/errors.html" %}
</div>
</div>
<div id='challenges-board'>
<div class="text-center">

View File

@@ -40,7 +40,7 @@ def ctftime():
def ctf_paused():
return get_config("paused")
return bool(get_config("paused"))
def ctf_started():

View File

@@ -207,14 +207,15 @@ def test_dynamic_challenge_loses_value_properly():
name = "user{}".format(team_id)
email = "user{}@ctfd.io".format(team_id)
# We need to bypass rate-limiting so gen_user instead of register_user
gen_user(app.db, name=name, email=email)
user = gen_user(app.db, name=name, email=email)
user_id = user.id
with app.test_client() as client:
# We need to bypass rate-limiting so creating a fake user instead of logging in
with client.session_transaction() as sess:
sess["id"] = team_id
sess["id"] = user_id
sess["nonce"] = "fake-nonce"
sess["hash"] = "fake-hash"
sess["hash"] = hmac(user.password)
data = {"submission": "flag", "challenge_id": 1}