Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add auser mock support for TestClient (#1252) #1339

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LuYanFCP
Copy link

@LuYanFCP LuYanFCP commented Nov 18, 2024

As a new open-source contributor, I recently encountered the same issue described in #1252 . I've created a simple patch to address this problem. fixes #1252

@vitalik
Copy link
Owner

vitalik commented Nov 22, 2024

Hi @LuYanFCP

The AsyncMock seems introduced in python 3.8+

I guess you can put custom async mock implementation (or just copy from 3.8) into https://github.com/vitalik/django-ninja/tree/master/ninja/compatibility folder and use it

@LuYanFCP
Copy link
Author

Hi @LuYanFCP

The AsyncMock seems introduced in python 3.8+

I guess you can put custom async mock implementation (or just copy from 3.8) into https://github.com/vitalik/django-ninja/tree/master/ninja/compatibility folder and use it

I will do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Mock Request Generated by Test Client Doesn’t Support auser()
2 participants