Skip to content

Commit

Permalink
Why is test failing
Browse files Browse the repository at this point in the history
  • Loading branch information
pamelafox committed Nov 21, 2024
1 parent e50a3b8 commit 11b1c7d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions flask_admin/contrib/fileadmin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1219,6 +1219,7 @@ def edit(self):

path = request.args.getlist("path")
if not path:
print("path is empty")
return redirect(self.get_url(".index_view"))

if len(path) > 1:
Expand Down Expand Up @@ -1287,6 +1288,7 @@ def edit(self):
form.content.data = content

if error:
print(error)
return redirect(next_url)

if self.edit_modal and request.args.get("modal"):
Expand Down
2 changes: 1 addition & 1 deletion flask_admin/tests/fileadmin/test_fileadmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class MyFileAdmin(fileadmin_class):

# edit
rv = client.get("/admin/myfileadmin/edit/?path=dummy.txt")
assert rv.status_code == 200
assert rv.status_code == 200 # 302ing here
assert "dummy.txt" in rv.data.decode("utf-8")

rv = client.post(
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ commands =
deps = -r requirements-skip/tests-min.txt
commands =
pip freeze
pytest -v --tb=short --basetemp={envtmpdir} flask_admin/tests -W 'default::DeprecationWarning' {posargs}
pytest -s -v --tb=short --basetemp={envtmpdir} flask_admin/tests -W 'default::DeprecationWarning' {posargs}

[testenv:style]
deps = pre-commit
Expand Down

0 comments on commit 11b1c7d

Please sign in to comment.