mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-18 14:34:21 +01:00
Format all the things (#991)
* Format Javascript and CSS files with `prettier`: `prettier --write 'CTFd/themes/**/*'` * Format Python with `black`: `black CTFd` & `black tests` * Travis now uses xenial instead of trusty.
This commit is contained in:
@@ -10,36 +10,34 @@ def test_api_csrf_failure():
|
||||
app = create_ctfd()
|
||||
app.test_client_class = FlaskClient
|
||||
with app.app_context():
|
||||
with login_as_user(app, 'admin') as client:
|
||||
with login_as_user(app, "admin") as client:
|
||||
r = client.post(
|
||||
'/api/v1/challenges',
|
||||
"/api/v1/challenges",
|
||||
json={
|
||||
"name": "chal",
|
||||
"category": "cate",
|
||||
"description": "desc",
|
||||
"value": "100",
|
||||
"state": "hidden",
|
||||
"type": "standard"
|
||||
}
|
||||
"type": "standard",
|
||||
},
|
||||
)
|
||||
assert r.status_code == 403
|
||||
|
||||
with client.session_transaction() as sess:
|
||||
nonce = sess.get('nonce')
|
||||
nonce = sess.get("nonce")
|
||||
|
||||
r = client.post(
|
||||
'/api/v1/challenges',
|
||||
headers={
|
||||
'CSRF-Token': nonce
|
||||
},
|
||||
"/api/v1/challenges",
|
||||
headers={"CSRF-Token": nonce},
|
||||
json={
|
||||
"name": "chal",
|
||||
"category": "cate",
|
||||
"description": "desc",
|
||||
"value": "100",
|
||||
"state": "hidden",
|
||||
"type": "standard"
|
||||
}
|
||||
"type": "standard",
|
||||
},
|
||||
)
|
||||
assert r.status_code == 200
|
||||
destroy_ctfd(app)
|
||||
|
||||
Reference in New Issue
Block a user