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
I had created the Admin CRUD and added authentication based on SQLAdmin app, While writing the testcase for admin CRUD, I authenticated the user by mocking the authenticate method from my custom authentication backend but it is not working
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I had created the Admin CRUD and added authentication based on SQLAdmin app, While writing the testcase for admin CRUD, I authenticated the user by mocking the authenticate method from my custom authentication backend but it is not working
Reference:
with patch(
"<path_of_the_file>.AuthenticationBackend.authenticate",
return_value=True,
):
response = await async_client.post(
f"/<route_path>/create",
data=data,
)
Require possible solutions to resolve the issue or else, is there any better approach to resolving the issue?
Note: I'm using Async session
Beta Was this translation helpful? Give feedback.
All reactions