Commit graph

346 commits

Author SHA1 Message Date
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
MikeTheReader
87081acf0b Parameterize test_get_debug_flag 2017-05-23 07:51:57 -07:00
MikeTheReader
3e42e38485 Modifications based on review 2017-05-22 20:49:37 -07:00
Randy Liou
5152fa9b38 Add coverage for Blueprint teardown request method
Test the following methods in the Blueprint object: teardown_request,
and teardown_app_request.
This PR increases the coverage of blueprint module by 3%.
2017-05-22 16:58:04 -07:00
Randy Liou
d4c1bfaa77 Add coverage for Blueprint request process methods
Add test to cover following methodss to the Blueprint object:
before_request, after_request, before_app_request,
before_app_first_request, after_app_request.
This PR increases the coverage of flask.blueprints by 6%.
2017-05-22 16:58:04 -07:00
MikeTheReader
2c38769336 Added tests for make_response and get_debug_flag to improve coverage of helpers.py 2017-05-22 16:15:48 -07:00
David Lord
28c8a78baf Merge pull request #2297 from HndrkMkt/#2265-auto-detect-create-app-function
Auto-detect create_app() in find_best_app() #2265
2017-05-22 16:13:27 -07:00
Randy Liou
5a5de52ab0 Add coverage for Blueprint.add_app_template_global
This tests the Blueprint.add_app_template_global mothod, which internally
calls the Blueprint.app_template_global method. The methods are used to
registering a function to the jinja template environment.
This PR increases the test coverage for module flask.blueprint by 4%.
2017-05-22 14:33:58 -07:00
David Lord
6a91f8443d Merge pull request #2298 from dawran6/test-bp-context
Add coverage for Blueprints.(app_)context_processor
2017-05-22 14:01:59 -07:00
Randy Liou
19d33ecfa7 Add coverage for Blueprints.(app_)context_processor
Test both context_processor and app_context_processor functions.
Two context parameters are added into the context: one added to
the blueprint locally; another added to the app globally. The test
asserts the behaviors in both blueprint scope and the app scope.
The coverage for flask.blueprints is increased by 3%.
2017-05-22 13:09:22 -07:00
Hendrik Makait
91633c21ec Auto-detect create_app and make_app factory functions 2017-05-22 12:30:18 -07:00
Randy Liou
158290e3b0 Add coverage for Blueprint.app_errorhandler
This test case registers an application-wise error handler from
a Blueprint. Verifies the error handler by aborting the flask app
from the application itself as well as from another registered
Blueprint.
2017-05-22 12:00:04 -07:00
David Lord
298bcfaeb6 set session accessed for setdefault 2017-05-20 13:00:17 -07:00
David Lord
409c8799d4 Merge branch 'master' into vary-cookies 2017-05-19 09:44:06 -07:00
David Lord
9ada22dd94 safe_join on Windows uses posixpath
fixes #2033
closes #2059
2017-05-15 16:58:01 -07:00
David Lord
9c7e73e955 refactor session cookie domain logic
cache result of session cookie domain
add warnings for session cookie domain issues
add changelog
2017-05-13 21:59:00 -07:00
David Lord
c279a827cc add sort by match order
sort by endpoint by default
combine sort flags
sort methods
ignore HEAD and OPTIONS methods by default
rearrange columns
use format to build row format string
rework tests
add changelog
2017-04-26 10:26:59 -07:00
David Lord
57515e1887 Merge branch 'master' into routes-command 2017-04-25 13:13:10 -07:00
David Lord
b54d8cfc5b refactor make_response to be easier to follow
* be explicit about how tuples are unpacked
* allow bytes for status value
* allow Headers for headers value
* use TypeError instead of ValueError
* errors are more descriptive
* document that view must not return None
* update documentation about return values
* test more response types
* test error messages

closes #1676
2017-04-25 08:30:48 -07:00
David Lord
6bed207562 clean up blueprint json support
add changelog for #1898
2017-04-24 10:16:50 -07:00
David Lord
07ae566f22 Merge pull request #1898 from RaHus/per_blueprint_jsoncoding_#1710
Per blueprint jsoncoding #1710
2017-04-24 10:16:20 -07:00