Issue in testing the ModelView with authenticatioin_backend #739
tariqjamal-abdulazeez
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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