mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Remove mutable default from template-rendere
This commit is contained in:
parent
298f9b225d
commit
a451b94387
|
@ -3,7 +3,10 @@ Jinja2 rendering utils, used to generate new strategy and configurations.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
def render_template(templatefile: str, arguments: dict = {}) -> str:
|
from typing import Dict
|
||||||
|
|
||||||
|
|
||||||
|
def render_template(templatefile: str, arguments: Dict) -> str:
|
||||||
|
|
||||||
from jinja2 import Environment, PackageLoader, select_autoescape
|
from jinja2 import Environment, PackageLoader, select_autoescape
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,9 @@ def test_render_template_fallback():
|
||||||
from jinja2.exceptions import TemplateNotFound
|
from jinja2.exceptions import TemplateNotFound
|
||||||
with pytest.raises(TemplateNotFound):
|
with pytest.raises(TemplateNotFound):
|
||||||
val = render_template(
|
val = render_template(
|
||||||
templatefile='subtemplates/indicators_does-not-exist.j2',)
|
templatefile='subtemplates/indicators_does-not-exist.j2',
|
||||||
|
arguments={},
|
||||||
|
)
|
||||||
|
|
||||||
val = render_template_with_fallback(
|
val = render_template_with_fallback(
|
||||||
templatefile='strategy_subtemplates/indicators_does-not-exist.j2',
|
templatefile='strategy_subtemplates/indicators_does-not-exist.j2',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user