Browse Source

Rename jinja_env_class

Inspired by #1056
pull/1486/head
Markus Unterwaditzer 10 years ago
parent
commit
d13a1b363e
  1. 4
      flask/app.py
  2. 2
      tests/test_templating.py

4
flask/app.py

@ -160,7 +160,7 @@ class Flask(_PackageBoundObject):
#: The class that is used for the Jinja environment.
#:
#: .. versionadded:: 1.0
jinja_env_class = Environment
jinja_environment = Environment
#: The class that is used for the :data:`~flask.g` instance.
#:
@ -685,7 +685,7 @@ class Flask(_PackageBoundObject):
options['auto_reload'] = self.config['TEMPLATES_AUTO_RELOAD']
else:
options['auto_reload'] = self.debug
rv = self.jinja_env_class(self, **options)
rv = self.jinja_environment(self, **options)
rv.globals.update(
url_for=url_for,
get_flashed_messages=get_flashed_messages,

2
tests/test_templating.py

@ -367,7 +367,7 @@ def test_custom_jinja_env():
pass
class CustomFlask(flask.Flask):
jinja_env_class = CustomEnvironment
jinja_environment = CustomEnvironment
app = CustomFlask(__name__)
assert isinstance(app.jinja_env, CustomEnvironment)

Loading…
Cancel
Save