mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 14:04:20 +01:00
Fixing challenge creation test (#460)
This commit is contained in:
@@ -124,13 +124,27 @@ def test_admins_can_create_challenges():
|
|||||||
'desc': 'description',
|
'desc': 'description',
|
||||||
'value': 100,
|
'value': 100,
|
||||||
'key_type[0]': 'static',
|
'key_type[0]': 'static',
|
||||||
'max_attempts': '',
|
'key': 'flag',
|
||||||
|
'max_attempts': 5,
|
||||||
'nonce': sess.get('nonce'),
|
'nonce': sess.get('nonce'),
|
||||||
'chaltype': 'standard'
|
'chaltype': 'standard'
|
||||||
}
|
}
|
||||||
r = client.post('/admin/chal/new', data=data)
|
r = client.post('/admin/chal/new', data=data)
|
||||||
|
assert r.status_code == 302
|
||||||
|
|
||||||
assert Challenges.query.count() == 1
|
assert Challenges.query.count() == 1
|
||||||
|
chal = Challenges.query.filter_by(id=1).first()
|
||||||
|
assert chal.name == '💫'
|
||||||
|
assert chal.category == '💫'
|
||||||
|
assert chal.max_attempts == 5
|
||||||
|
assert chal.description == 'description'
|
||||||
|
assert chal.value == 100
|
||||||
|
assert chal.type == 'standard'
|
||||||
|
|
||||||
|
assert Keys.query.count() == 1
|
||||||
|
key = Keys.query.filter_by(id=1).first()
|
||||||
|
assert key.key_type == 'static'
|
||||||
|
assert key.flag == 'flag'
|
||||||
destroy_ctfd(app)
|
destroy_ctfd(app)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user