mongo_bakery
Inspired by model-bakery, this project aims to simplify the process of creating MongoDB documents for testing purposes. The goal is to deliver a maintainable, intuitive, and developer-friendly API specifically designed for MongoDB. By streamlining the generation of test data, this tool will empower developers to efficiently create realistic document structures, enhancing the testing workflow for applications that rely on MongoDB as their primary database.
Motivation
- To have the conveniences of model_bakery (from the Django world) in Flask with MongoEngine.
- We want more context within the test itself (instead of having fixtures in conftest where we don't know which fields are populated).
- We don't want to create a Factory for every Document in the application.
Alternatives
Draft Solution
Contributing
We welcome contributions to the mongo_bakery project! Here are the steps to get started:
-
Fork the Repository: Fork the mongo_bakery repository on GitHub.
-
Clone Your Fork: Clone your forked repository to your local machine.
git clone https://github.com/your-username/mongo_bakery.git cd mongo_bakery
-
Create a Branch: Create a new branch for your feature or bugfix.
git checkout -b branch-name
-
Install Dependencies: Install the required dependencies. We use the uv tool to manage our prject dependencies and vitualenv. So it is a prerequisite to the project.
uv syncThis command will create the Python virtual environment with the Python version of the project and install all dependencies.
-
Make Changes: Implement your feature or bugfix.
-
Run Tests and Lint: Ensure all tests and lint pass before submitting your changes.
uv run task test
This command runs
ruff checkas a lint,pytestto run all tests, andcoverage htmlto generate an html report of test coverage. This html report is for the development side only. On our CI with Github Actions, it runspytest --cov=mongo_bakery --cov-report=xmlto generate a report that is send to codecov.io -
Commit Changes: Commit your changes with a descriptive commit message. Use Conventional Commits to write your commit messages.
git add . git commit -m "feat(issue4): Description of your changes"
-
Push to GitHub: Push your changes to your forked repository.
git push origin branch-name
-
Create a Pull Request: Open a pull request on the original repository. Provide a clear description of your changes and any relevant information.
-
Review Process: Your pull request will be reviewed by the maintainers. Be prepared to make any necessary changes based on feedback.
Contributors
Made with contrib.rocks.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mongo_bakery-0.1.0.tar.gz.
File metadata
- Download URL: mongo_bakery-0.1.0.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dae1d2e0283104d090193a80f057deb5de1c0ae5736fd57b3ae0e2840ab3aa73
|
|
| MD5 |
094fbb245057078f29809716057ea44f
|
|
| BLAKE2b-256 |
5e10b3e3833d33bf4448d78136d150f54ef1776e476517f26e817089a2877d73
|
File details
Details for the file mongo_bakery-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mongo_bakery-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82817ff79b6e6d21eefb4166ed3ade234d4ee8c8b444823a1dbf10374d6b3d64
|
|
| MD5 |
a20eec0afe769f1c78af668eb5122a4c
|
|
| BLAKE2b-256 |
65e21ee6fa19b460ca06ee10b44d856d812a08eccb5989bbafca773dab849898
|