django_factory_boy
When testing a django app, a common case is to create some data, then test app behavior around that test data. This is usually done with fixtures, but this includes some pain.
factory_boy is useful for concisely creating objects, particularly for test data.
This project will supply factory_boy classes for each model Django ships. The factories are named after the class it constructs. For example, a factory for django.contrib.auth.models.User is available at django_factory_boy.auth.UserFactory.
See factory_boy for detailed docs, but all fields are given default values which can be overriden by passing keyword arguments to the constructor. For example:
from django_factory_boy import auth as auth_factories user = auth_factories.UserFactory(first_name="test")
would result in a saved User instance whose first_name is set to "test".
The resulting objects are normal django model instances, so once they are constructed you can use them in the normal ways.
Not all django models have been added yet; if you need one, open an issue or a pull request. Currently supported:
contrib.auth (UserFactory, GroupFactory, PermissionFactory)
contrib.sites (SiteFactory)
This project intends to support all Python versions which Django does - 2.6 - 3.4 as of Django 1.6. It supports all Django versions from 1.6 onwards.
Metadata
Release files for django-factory_boy 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-factory_boy-1.0.0.tar.gz | 3.3 kB | Without provenance | Details for django-factory_boy-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_factory_boy-1.0.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for django_factory_boy-1.0.0-py2.py3-none-any.whl |
Total release size: 8.0 kB
Release files / django-factory_boy-1.0.0.tar.gz
| Download URL | django-factory_boy-1.0.0.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f1e08a8f6f11f59417f0e7d7cde1f2290ea16b94209cb89b72158c651f8d6d7f
|
|
BLAKE2b-256 checksum How to use checksums |
f8f99ecedc33389c173b1b4f81a96302d505a65270940b0d9e4174f7f4a4bad1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / django_factory_boy-1.0.0-py2.py3-none-any.whl
| Download URL | django_factory_boy-1.0.0-py2.py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
354a8a0d44509efd1067ccaab1139b11ab646734ab0b32a0c2d5339ddafd4847
|
|
BLAKE2b-256 checksum How to use checksums |
48cd8b621172685cb8ac312187c88d72d93c3a7f7773abb88481341b6dcbf626
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-factory_boy 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.