Skip to content

Commit

Permalink
fix: revert and dont use safe in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
euri10 committed Aug 28, 2023
1 parent 1c16948 commit 170cd6c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/unit/test_template/test_builtin_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def complex_handler() -> None:
with create_test_client(
route_handlers=[simple_handler, complex_handler, tpl_renderer], template_config=template_config
) as client:
Path(tmp_path / "simple.html").write_text("{{ url_for('simple')|safe }}")
Path(tmp_path / "simple.html").write_text("{{ url_for('simple') }}")

response = client.get("/simple.html")
assert response.status_code == 200
Expand All @@ -209,7 +209,7 @@ def complex_handler() -> None:
route_handlers=[simple_handler, complex_handler, tpl_renderer], template_config=template_config
) as client:
Path(tmp_path / "complex_args_kwargs.html").write_text(
"{{ url_for('complex', int_param=100, time_param='18:00')|safe }}"
"{{ url_for('complex', int_param=100, time_param='18:00') }}"
)

response = client.get("/complex_args_kwargs.html")
Expand All @@ -220,7 +220,7 @@ def complex_handler() -> None:
route_handlers=[simple_handler, complex_handler, tpl_renderer], template_config=template_config
) as client:
# missing route params should cause 500 err
Path(tmp_path / "complex.html").write_text("{{ url_for('complex')|safe }}")
Path(tmp_path / "complex.html").write_text("{{ url_for('complex') }}")
response = client.get("/complex.html")
assert response.status_code == 500

Expand Down Expand Up @@ -257,7 +257,7 @@ def tpl_renderer(path: Path) -> Template:
template_config=template_config,
static_files_config=[StaticFilesConfig(path="/static/css", directories=[tmp_path], name="css")],
) as client:
Path(tmp_path / "working.html").write_text("{{ url_for_static_asset('css', 'main/main.css') | safe }}")
Path(tmp_path / "working.html").write_text("{{ url_for_static_asset('css', 'main/main.css') }}")

response = client.get("/working.html")
assert response.status_code == 200
Expand Down

0 comments on commit 170cd6c

Please sign in to comment.