Open ahonnecke opened 4 years ago
Hi! Thanks for the report; however, I'm not sure I understand what issue you're having?
When testing the integration of factory_boy with MongoDB-based mappers, we need an actually running MongoDB instance.
The connection details for that instance can be configured through the MONGO_HOST
, MONGO_PORT
and MONGO_DATABASE
environment variables.
I usually start a local, temporary instance through docker: docker run --rm --publish 27017:27017 mongo:latest
.
Would adding this information to the documentation help solve the problem you've encountered?
Ah, I suspect so! THank you! I'll probably add a mongo instance as a dependency of my pytest service in my docker-compose, would you like me to PR the documentation for that back up?
Description
mongoengine test in factory_boy tries to connect to mongo
I was running into some issues mocking out mongo objects with factory boy. In order to narrow down where the issue is, I grabbed the test_mongoengine file from this repository and tried running it. It did not work.
To Reproduce (My app)
Run the test_mongoengine test in this repository
Model / Factory code
The issue
Notes