Commit graph

371 commits

Author SHA1 Message Date
David Lord
bffe2a0af9 un-deprecate request.json 2017-06-26 09:34:26 -07:00
David Lord
0207aad0ec remove deprecated flask.ext 2017-06-26 08:47:28 -07:00
David Lord
fc2b8aabde remove deprecated Request.module 2017-06-26 07:46:33 -07:00
David Lord
24cfe1b9b1 remove deprecated Flask.static_path 2017-06-26 07:45:29 -07:00
David Lord
b96a1c0f99 style cleanup
[ci skip]
2017-06-16 06:59:37 -07:00
Miguel Grinberg
ce78369f37 Import app from wsgi.py or app.py if FLASK_APP is not defined
Fixes #2376
2017-06-15 11:27:50 -07:00
Eugene M. Kim
015440ded5 Actually hand-spin and use a tzinfo subclass
This is for Python 2.x compatibility.

Suggested-by: David Lord <davidism@gmail.com>
2017-06-14 14:23:13 -07:00
Eugene M. Kim
fee894e9e8 Re-revert to not using pytz
Will spin a tzinfo subclass.
2017-06-14 14:14:18 -07:00
Eugene M. Kim
e8113c4b77 Skip aware datetime tests if pytz is unavailable 2017-06-14 14:08:42 -07:00
Eugene M. Kim
ed5ff89800 Use pytz again for tests
This is because datetime.timezone is Python 3 only.  The only
alternative would be to hand-spin a datetime.tzinfo subclass, an
overkill.

This reverts commit 0e6cab3576.
2017-06-14 13:57:40 -07:00
Eugene M. Kim
8df850cc9d Merge branch 'master' of github.com:pallets/flask into json_encode_non_utc_datetimes 2017-06-14 13:11:53 -07:00
Eugene M. Kim
45bfd49231 Rewrite test_jsonify_aware_datetimes without pytz 2017-06-14 13:06:26 -07:00
David Lord
96e7553f10 test no debug flag doesn't reconfigure
test templates_auto_reload property instead of config
use app fixture in test
2017-06-14 12:31:56 -07:00
Eugene M. Kim
8b3fb19a0a Add UTs for #2372
test_encode_aware_datetime() fails for non-UTC timezones due to the bug.
2017-06-14 12:22:09 -07:00
David Lord
0e1f7d5859 Merge branch 'master' into reload_templates_run_debug 2017-06-14 09:58:33 -07:00
David Lord
08c8401539 failing test 2017-06-05 06:14:13 -07:00
David Lord
ca0dbc87a9 clean up JSON code and docs 2017-06-04 11:44:00 -07:00
David Lord
1ed4062f8f Merge remote-tracking branch 'remotes/origin/master' into json-mixin 2017-06-04 09:42:39 -07:00
David Lord
f542c5f599 failing test for streaming session 2017-06-02 11:07:53 -07:00
David Lord
9c93ba2fa2 add tests for flask.json.tag 2017-06-02 10:01:30 -07:00
David Lord
7fd443c9ef Merge branch 'master' into json-object-hook 2017-06-01 06:40:27 -07:00
David Lord
35d32d265a show nice message when registering error handler for unknown code
clean up error handler docs
closes #1837
2017-05-31 18:04:08 -07:00
David Lord
c79abcb86c set description for trap as well as debug
test for key error description
2017-05-29 19:41:07 -07:00
David Lord
1fbe779fd2 make debugging bad key errors easier
* TRAP_BAD_REQUEST_ERRORS is enabled by default in debug mode
* BadRequestKeyError has the key in the description in debug mode

closes #382
2017-05-29 19:08:25 -07:00
David Lord
0873d085b1 use existing response.vary property to set vary header
closes #2345
2017-05-29 10:09:24 -07:00
David Lord
dfc586e391 Merge remote-tracking branch 'origin/0.10-maintenance'
refactor make_test_environ_builder
2017-05-28 07:25:15 -07:00
Kenneth Reitz
d4b4b7eb39 Merge pull request #2326 from HndrkMkt/#2264-handle-app-factory-in-FLASK_APP
Handle app factory with arguments in FLASK_APP
2017-05-25 14:57:17 -07:00
Kenneth Reitz
d9c2a2fb45 Merge branch 'master' into master 2017-05-25 14:22:53 -07:00
Hendrik Makait
a115c6b025 Factor in code review comments and refactor functions to be more naturally split. 2017-05-25 11:28:20 -07:00
Hendrik Makait
e5dff166de Handle app factory with arguments in FLASK_APP 2017-05-25 10:11:42 -07:00
Nina Zakharenko
c850aee84c Don't overwrite Vary header when setting for cookie access #2317 2017-05-24 20:05:11 -07:00
Christian Stade-Schuldt
55b92efab4 More DRYing up the test suite (#2325) 2017-05-24 17:27:36 -07:00
David Lord
03d39490a3 Merge pull request #2324 from rzelayafavila/2313-refactor-gevent-tests-into-class
Fix for Issue 2313 - refactoring gevent tests into class
2017-05-23 17:31:44 -07:00
David Lord
f710fc6347 Merge pull request #2323 from dawran6/test-fixture
Cleanup test_blueprint.py to use test fixtures
2017-05-23 17:14:57 -07:00
Rene A. Zelaya
8eeb3d8297 Correcting name of GreenletContextCopying test class (to start with 'Test'), making it extend object, and also having the test methods in it include 'self' as first argument. 2017-05-23 16:51:50 -07:00
Rene A. Zelaya
f6e3c14313 Merge remote-tracking branch 'pallets/master' into 2313-refactor-gevent-tests-into-class 2017-05-23 16:45:47 -07:00
Rene A. Zelaya
cb2c8a7b88 Bundling 'test_greenlet_context_copying' functions into a new class in tests/test_reqctx.py. 2017-05-23 16:45:11 -07:00
Randy Liou
b372260079 Cleanup test_blueprint.py to use test fixtures
Modify several tests to use the app and client test fixtures.
2017-05-23 16:42:14 -07:00
Randy Liou
a1e09231f5 Add test for Blueprint app-wide url processing
The test add coverage for methods: Blueprint.app_url_defaults, and
Blueprint.app_url_preprocessing. This PR increases the coverage of
blueprint module by 2%.
2017-05-23 16:26:53 -07:00
David Lord
f7f122cb29 Merge pull request #2319 from HndrkMkt/#2266-support-create-app-without-script-info
Support `create_app` without script_info or with script_info as named argument
2017-05-23 16:24:29 -07:00
Christian Stade-Schuldt
2158fe3e12 DRYing up the test suite using pytest fixtures (#2306)
* add fixtures to conftest.py

* use fixtures in test_appctx.py

* use fixtures in test_blueprints.py

* use fixtures in test_depreciations.py

* use fixtures in test_regressions.py

* use fixtures in test_reqctx.py

* use fixtures in test_templating.py

* use fixtures in test_user_error_handler.py

* use fixtures in test_views.py

* use fixtures in test_basics.py

* use fixtures in test_helpers.py

* use fixtures in test_testing.py

* update conftest.py

* make docstrings  PEP-257 compliant

* cleanup

* switch dictonary format

* use pytest parameterization for test_json_as_unicode
2017-05-23 15:18:39 -07:00
Hendrik Makait
3d220155b9 Check if app factory takes script_info argument and call it with(out) script_info as an argument depending on that 2017-05-23 13:48:42 -07:00
David Lord
f2a26657c3 Merge pull request #2316 from ka7eh/automatic-options-in-views
Adds provide_automatic_options to Class-based Views
2017-05-23 12:46:31 -07:00
David Lord
47717e5564 Merge pull request #2311 from bovarysme/use-yield-syntax
Use the yield syntax in pytest's fixtures
2017-05-23 12:00:34 -07:00
kaveh
24fe84adab Adds provide_automatic_options to Class-based Views 2017-05-23 11:51:13 -07:00
cerickson
145d362587 Added support for generic HTTPException handlers on app and blueprints
Error handlers are now returned in order of blueprint:code, app:code,
blueprint:HTTPException, app:HTTPException, None

Corresponding tests also added.

Ref issue #941, pr #1383, #2082, #2144
2017-05-23 10:45:42 -07:00
Florian Sachs
1b691415be Register errorhandlers for Exceptions
Allow a default errorhandler by registering
an errorhandler for HTTPException

tests included
2017-05-23 10:34:31 -07:00
bovarysme
e94527717e Use the yield syntax in pytest's fixtures 2017-05-23 18:21:29 +02:00
David Lord
739d099c15 Merge pull request #2303 from MikeTheReader/master
Added tests for make_response and get_debug_flag to improve coverage of helpers.py
2017-05-23 08:34:22 -07:00
MikeTheReader
e81deed87a Replace double quotes with single quotes 2017-05-23 07:59:53 -07:00