Skip to content
Myr

Added a test for content length behavior

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent 34e6933 · Browse files · 1 file+16 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+16 added−0 removed

  • tests:+16 added−0 removed

1 file+16 added−0 removed

modified:tests/flask_tests.py+16 added
780 unmodified lines
781 t = Thread(target=apprunner, args=(config_key,))782 t.start()783 t.join()784785 def test_max_content_length(self):786 app = flask.Flask(__name__)787 app.debug = True788 app.config['MAX_CONTENT_LENGTH'] = 64789 @app.route('/accept', methods=['POST'])790 def accept_file():791 flask.request.form['myfile']792 assert False793 @app.errorhandler(413)794 def catcher(error):795 return '42'796797 c = app.test_client()798 rv = c.post('/accept', data={'myfile': 'foo' * 100})799 assert rv.data == '42'800801802class JSONTestCase(unittest.TestCase):803804 def test_json_body_encoding(self):805 app = flask.Flask(__name__)
813 unmodified lines