Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@dni
Copy link
Member

@dni dni commented Mar 26, 2024

removes warnings

tests/core/views/test_generic.py::test_core_views_generic
tests/core/views/test_generic.py::test_get_wallet_with_user_and_wallet
tests/core/views/test_generic.py::test_get_extensions
tests/core/views/test_public_api.py::test_core_views_generic
  /home/dni/.cache/pypoetry/virtualenvs/lnbits-XeqO4Z-j-py3.10/lib/python3.10/site-packages/starlette/templating.py:178: DeprecationWarning: The `name` is not the first para
meter anymore. The first parameter should be the `Request` instance.
  Replace `TemplateResponse(name, {"request": request})` by `TemplateResponse(request, name)`.
    warnings.warn(

@dni dni requested review from motorina0 and prusnak March 26, 2024 21:49
@codecov
Copy link

codecov bot commented Mar 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 58.50%. Comparing base (9b5bb1b) to head (4eae10e).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #2368   +/-   ##
=======================================
  Coverage   58.50%   58.50%           
=======================================
  Files          65       65           
  Lines        9379     9379           
=======================================
  Hits         5487     5487           
  Misses       3892     3892           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dni dni requested a review from talvasconcelos March 27, 2024 07:13
dni added 2 commits March 28, 2024 10:32
removes warnings
```
tests/core/views/test_generic.py::test_core_views_generic
tests/core/views/test_generic.py::test_get_wallet_with_user_and_wallet
tests/core/views/test_generic.py::test_get_extensions
tests/core/views/test_public_api.py::test_core_views_generic
  /home/dni/.cache/pypoetry/virtualenvs/lnbits-XeqO4Z-j-py3.10/lib/python3.10/site-packages/starlette/templating.py:178: DeprecationWarning: The `name` is not the first para
meter anymore. The first parameter should be the `Request` instance.
  Replace `TemplateResponse(name, {"request": request})` by `TemplateResponse(request, name)`.
    warnings.warn(
```
@dni dni added this to the 0.12.5 milestone Mar 29, 2024
@dni dni added testing Code testing code health Make the code more beautiful labels Mar 29, 2024
@motorina0
Copy link
Collaborator

I assume this change has to be performed on all extensions too.

Suggestion: abstract the TemplateResponse so future changes to fastapi will only be handled in one place.

From:

return template_renderer().TemplateResponse(
    request, "error.html", {"err": f"Error: {str(exc)}"}
)

To:

return template_response_renderer(
  request, "error.html", {"err": f"Error: {str(exc)}"}
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code health Make the code more beautiful testing Code testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants