def test_app():
# app's config should be loaded from instance/config.py
assert app.config['STORAGE_TYPE'] == 'file'
assert app.config['THEME'] == 'test'
with app.test_request_context('/'):
app.send_static_file('no-use.css')
app.send_static_file('no-use-2.css')
with raises(NotFound):
app.send_static_file('non-exists.css')
origin_mode = app.config['MODE']
app.config['MODE'] = 'api-only'
with app.test_request_context('/'):
with raises(NotFound):
app.send_static_file('no-use.css')
app.config['MODE'] = origin_mode
评论列表
文章目录