vitalik / django-ninja

💨 Fast, Async-ready, Openapi, type hints based framework for building APIs
https://django-ninja.dev
MIT License
7.34k stars 437 forks source link

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

Open LuYanFCP opened 1 week ago

LuYanFCP commented 1 week ago

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 commented 4 days ago

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 commented 1 day ago

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.