Fixing challenge creation test (#460)

This commit is contained in:
Kevin Chung
2017-11-14 23:12:28 -05:00
committed by GitHub
parent 6fbef4f32e
commit 647d8e0b2d

View File

@@ -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)