You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Django 5.0, request.auser() is added to access the authenticated user in async style (doc). This can be helpful for use cases like async authentication callback. But Django Ninja's test client doesn't support it yet.
Accessing the view in an actual API works as expected. But when running the test the following error is raised: TypeError: object Mock can't be used in 'await' expression during the line user = await request.auser().
Versions (please complete the following information):
Python version: 3.12
Django version: 5.0.7
Django-Ninja version: 1.2.2
Pydantic version: 2.8.2
The text was updated successfully, but these errors were encountered:
LuYanFCP
added a commit
to LuYanFCP/django-ninja
that referenced
this issue
Nov 18, 2024
Describe the bug
In Django 5.0,
request.auser()
is added to access the authenticated user in async style (doc). This can be helpful for use cases like async authentication callback. But Django Ninja's test client doesn't support it yet.Example Code:
Accessing the view in an actual API works as expected. But when running the test the following error is raised:
TypeError: object Mock can't be used in 'await' expression
during the lineuser = await request.auser()
.Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: