forked from orbit-oss/flask
Static files are active in the WSGI app now, not just the server.
This commit is contained in:
parent
08f1f0dc32
commit
ca520fb7e4
3 changed files with 15 additions and 5 deletions
|
|
@ -143,6 +143,15 @@ class BasicFunctionality(unittest.TestCase):
|
|||
with app.test_request_context():
|
||||
assert flask.url_for('hello', name='test x') == '/hello/test%20x'
|
||||
|
||||
def test_static_files(self):
|
||||
app = flask.Flask(__name__)
|
||||
rv = app.test_client().get('/static/index.html')
|
||||
assert rv.status_code == 200
|
||||
assert rv.data.strip() == '<h1>Hello World!</h1>'
|
||||
with app.test_request_context():
|
||||
assert flask.url_for('static', filename='index.html') \
|
||||
== '/static/index.html'
|
||||
|
||||
|
||||
class Templating(unittest.TestCase):
|
||||
|
||||
|
|
|
|||
1
tests/static/index.html
Normal file
1
tests/static/index.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<h1>Hello World!</h1>
|
||||
Loading…
Add table
Add a link
Reference in a new issue