Replies: 1 comment 1 reply
-
It looks like this is supported: https://github.com/michaelkryukov/mongomock_motor/blob/main/tests/test_beanie.py |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First off I love Beanie. I'm currently moving two projects from MongoEngine, one also using Graphene (for GraphQL) to Beanie and Strawberry (GraphQL). Absolutely love it! So everything works great, the only issue is with Pytest and MongoMock. I'm using LInk's which are implemented as DBRef's. When I save a document with Link's with MongoMock the DBRef's are not saved. It looks like this is an issue with MongoMock and not Beanie. So for the interim I had to work around this by using ObjectId's (PydanticObjectId) in the tests and disable some tests which rely on Link's in find/find_one calls. I also tried to save the Link's as DBRef's expicitly in the tests, however these were not saved as well.
Can we reach out to the developers of MongoMock to get DBRef's properly implemented? Beanie is awesome and having a proper Pytest framework support would be great. If there is an alternative to MongoMock which supports DBRef's, Motor and Beanie I would would love to hear of it?
Thanks,
Mark
Beta Was this translation helpful? Give feedback.
All reactions