Browse Source

Added a test for content length behavior

pull/238/head
Armin Ronacher 14 years ago
parent
commit
e3f2dd8f08
  1. 16
      tests/flask_tests.py

16
tests/flask_tests.py

@ -782,6 +782,22 @@ class BasicFunctionalityTestCase(unittest.TestCase):
t.start()
t.join()
def test_max_content_length(self):
app = flask.Flask(__name__)
app.debug = True
app.config['MAX_CONTENT_LENGTH'] = 64
@app.route('/accept', methods=['POST'])
def accept_file():
flask.request.form['myfile']
assert False
@app.errorhandler(413)
def catcher(error):
return '42'
c = app.test_client()
rv = c.post('/accept', data={'myfile': 'foo' * 100})
assert rv.data == '42'
class JSONTestCase(unittest.TestCase):

Loading…
Cancel
Save