mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-18 06:24:23 +01:00
Fix up reset ui
This commit is contained in:
@@ -78,20 +78,6 @@ def test_reset():
|
||||
|
||||
client = login_as_user(app, name="admin", password="password")
|
||||
|
||||
with client.session_transaction() as sess:
|
||||
data = {"nonce": sess.get("nonce"), "submissions": "on"}
|
||||
r = client.post("/admin/reset", data=data)
|
||||
assert r.location.endswith("/admin/statistics")
|
||||
assert Submissions.query.count() == 0
|
||||
assert Solves.query.count() == 0
|
||||
assert Fails.query.count() == 0
|
||||
assert Awards.query.count() == 0
|
||||
assert Unlocks.query.count() == 0
|
||||
assert Users.query.count() == 11
|
||||
assert Challenges.query.count() == 10
|
||||
assert Flags.query.count() == 10
|
||||
assert Tracking.query.count() == 11
|
||||
|
||||
with client.session_transaction() as sess:
|
||||
data = {"nonce": sess.get("nonce"), "pages": "on"}
|
||||
r = client.post("/admin/reset", data=data)
|
||||
@@ -123,6 +109,20 @@ def test_reset():
|
||||
assert Users.query.count() == 11
|
||||
assert Tracking.query.count() == 11
|
||||
|
||||
with client.session_transaction() as sess:
|
||||
data = {"nonce": sess.get("nonce"), "submissions": "on"}
|
||||
r = client.post("/admin/reset", data=data)
|
||||
assert r.location.endswith("/admin/statistics")
|
||||
assert Submissions.query.count() == 0
|
||||
assert Solves.query.count() == 0
|
||||
assert Fails.query.count() == 0
|
||||
assert Awards.query.count() == 0
|
||||
assert Unlocks.query.count() == 0
|
||||
assert Users.query.count() == 11
|
||||
assert Challenges.query.count() == 0
|
||||
assert Flags.query.count() == 0
|
||||
assert Tracking.query.count() == 0
|
||||
|
||||
with client.session_transaction() as sess:
|
||||
data = {"nonce": sess.get("nonce"), "accounts": "on"}
|
||||
r = client.post("/admin/reset", data=data)
|
||||
@@ -187,21 +187,6 @@ def test_reset_team_mode():
|
||||
|
||||
client = login_as_user(app, name="admin", password="password")
|
||||
|
||||
with client.session_transaction() as sess:
|
||||
data = {"nonce": sess.get("nonce"), "submissions": "on"}
|
||||
r = client.post("/admin/reset", data=data)
|
||||
assert r.location.endswith("/admin/statistics")
|
||||
assert Submissions.query.count() == 0
|
||||
assert Solves.query.count() == 0
|
||||
assert Fails.query.count() == 0
|
||||
assert Awards.query.count() == 0
|
||||
assert Unlocks.query.count() == 0
|
||||
assert Teams.query.count() == 10
|
||||
assert Users.query.count() == 51
|
||||
assert Challenges.query.count() == 10
|
||||
assert Flags.query.count() == 10
|
||||
assert Tracking.query.count() == 11
|
||||
|
||||
with client.session_transaction() as sess:
|
||||
data = {"nonce": sess.get("nonce"), "pages": "on"}
|
||||
r = client.post("/admin/reset", data=data)
|
||||
@@ -236,6 +221,21 @@ def test_reset_team_mode():
|
||||
assert Users.query.count() == 51
|
||||
assert Tracking.query.count() == 11
|
||||
|
||||
with client.session_transaction() as sess:
|
||||
data = {"nonce": sess.get("nonce"), "submissions": "on"}
|
||||
r = client.post("/admin/reset", data=data)
|
||||
assert r.location.endswith("/admin/statistics")
|
||||
assert Submissions.query.count() == 0
|
||||
assert Solves.query.count() == 0
|
||||
assert Fails.query.count() == 0
|
||||
assert Awards.query.count() == 0
|
||||
assert Unlocks.query.count() == 0
|
||||
assert Teams.query.count() == 10
|
||||
assert Users.query.count() == 51
|
||||
assert Challenges.query.count() == 0
|
||||
assert Flags.query.count() == 0
|
||||
assert Tracking.query.count() == 0
|
||||
|
||||
with client.session_transaction() as sess:
|
||||
data = {"nonce": sess.get("nonce"), "accounts": "on"}
|
||||
r = client.post("/admin/reset", data=data)
|
||||
|
||||
Reference in New Issue
Block a user