FactoryBoy / factory_boy

A test fixtures replacement for Python
https://factoryboy.readthedocs.io/
MIT License
3.45k stars 384 forks source link

Request: supporting Tortoise ORM #1069

Open jamesbraza opened 3 months ago

jamesbraza commented 3 months ago

The problem

I came from a company that uses SQLAlchemy + factory_boy, and I loved it. Now, I have joined a company that uses Tortoise ORM. It would be nice to continue using factory_boy, as it's useful.

I see as of https://github.com/FactoryBoy/factory_boy/releases/tag/3.3.0, the ORMS docs (link) don't mention Tortoise ORM.

Proposed solution

It would be nice to either:

Extra notes

None at this time

rbarrois commented 2 months ago

Hi,

Thanks for the suggestion. I do not think any of the maintainers use Tortoise ORM — and I'm not too keen on adding support for every ORM under the sun. We're already stretched somewhat thin, so I'm not too keen on adding a further maintenance load on ourselves, I'm sorry.

However, the second option you suggest is interesting: we could describe a TortoiseModelFactory as an example in an How to create a base factory for another ORM document!

Do you have some details as to how Tortoise handles: