mirror of
https://github.com/pallets-eco/flask-debugtoolbar.git
synced 2026-05-04 15:29:12 -05:00
Add basic sanity test
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
language: python
|
||||
python: "2.7"
|
||||
env:
|
||||
- TOXENV=py26
|
||||
- TOXENV=py27
|
||||
- TOXENV=py33
|
||||
install:
|
||||
- pip install tox --use-mirrors
|
||||
script: tox
|
||||
@@ -0,0 +1,17 @@
|
||||
from flask import Flask, render_template
|
||||
from flask_debugtoolbar import DebugToolbarExtension
|
||||
|
||||
app = Flask('basic_app')
|
||||
app.debug = True
|
||||
app.config['SECRET_KEY'] = 'abc123'
|
||||
|
||||
# make sure these are printable in the config panel
|
||||
app.config['BYTES_VALUE'] = b'\x00'
|
||||
app.config['UNICODE_VALUE'] = u'\uffff'
|
||||
|
||||
toolbar = DebugToolbarExtension(app)
|
||||
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
return render_template('basic_app.html')
|
||||
@@ -0,0 +1,4 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<body>Hello world</body>
|
||||
</html>
|
||||
@@ -0,0 +1,11 @@
|
||||
def load_app(name):
|
||||
app = __import__(name).app
|
||||
app.config['TESTING'] = True
|
||||
return app.test_client()
|
||||
|
||||
|
||||
def test_basic_app():
|
||||
app = load_app('basic_app')
|
||||
index = app.get('/')
|
||||
assert index.status_code == 200
|
||||
assert b'<div id="flDebug"' in index.data
|
||||
Reference in New Issue
Block a user