This allows blueprints to be nested within blueprints via a new
Blueprint.register_blueprint method. This should provide a use case
that has been desired for the past ~10 years.
This works by setting the endpoint name to be the blueprint names,
from parent to child delimeted by "." and then iterating over the
blueprint names in reverse order in the app (from most specific to
most general). This means that the expectation of nesting a blueprint
within a nested blueprint is met.
The implementations were moved to Werkzeug, Flask's functions become
wrappers around Werkzeug to pass some Flask-specific values.
cache_timeout is renamed to max_age. SEND_FILE_MAX_AGE_DEFAULT,
app.send_file_max_age_default, and app.get_send_file_max_age defaults
to None. This tells the browser to use conditional requests rather than
a 12 hour cache.
attachment_filename is renamed to download_name, and is always sent if
a name is known.
Deprecate helpers.safe_join in favor of werkzeug.utils.safe_join.
Removed most of the send_file tests, they're tested in Werkzeug.
In the file upload example, renamed the uploaded_file view to
download_file to avoid a common source of confusion.
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%.
* 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
Test the following methods in the Blueprint object: teardown_request,
and teardown_app_request.
This PR increases the coverage of blueprint module by 3%.
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%.
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%.
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%.
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.