All Projects → model-bakers → Model_bakery

model-bakers / Model_bakery

Licence: other
Object factory for Django

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Model bakery

Factory boy
A test fixtures replacement for Python
Stars: ✭ 2,712 (+726.83%)
Mutual labels:  django, fixtures
Django Smuggler
Django Smuggler is a pluggable application for Django Web Framework that helps you to import/export fixtures via the automatically-generated administration interface.
Stars: ✭ 350 (+6.71%)
Mutual labels:  django, fixtures
Letsmapyournetwork
Lets Map Your Network enables you to visualise your physical network in form of graph with zero manual error
Stars: ✭ 305 (-7.01%)
Mutual labels:  django
Joplin Web
🐍 📚 Web application companion for Joplin
Stars: ✭ 324 (-1.22%)
Mutual labels:  django
Django Oidc Provider
OpenID Connect and OAuth2 provider implementation for Djangonauts.
Stars: ✭ 320 (-2.44%)
Mutual labels:  django
Mediacms
MediaCMS is a modern, fully featured open source video and media CMS, written in Python/Django and React, featuring a REST API.
Stars: ✭ 313 (-4.57%)
Mutual labels:  django
Vas3k.club
No bullshit IT community with private membership
Stars: ✭ 321 (-2.13%)
Mutual labels:  django
Apm Agent Python
Official Python agent for the Elastic APM
Stars: ✭ 301 (-8.23%)
Mutual labels:  django
Awesome Cheatsheets
👩‍💻👨‍💻 Awesome cheatsheets for popular programming languages, frameworks and development tools. They include everything you should know in one single file.
Stars: ✭ 26,007 (+7828.96%)
Mutual labels:  django
Architect
A set of tools which enhances ORMs written in Python with more features
Stars: ✭ 320 (-2.44%)
Mutual labels:  django
Django Easy Pdf
PDF views, the easy way
Stars: ✭ 324 (-1.22%)
Mutual labels:  django
Django Wordpress
WordPress models and views for Django.
Stars: ✭ 318 (-3.05%)
Mutual labels:  django
Adagios
Adagios - Web Based Nagios Configuration
Stars: ✭ 317 (-3.35%)
Mutual labels:  django
Django React Templatetags
A quick way to add React components to your Django templates.
Stars: ✭ 324 (-1.22%)
Mutual labels:  django
E Book
Python电子书、Django电子书、鸟哥的Linux私房菜第四版PDF
Stars: ✭ 310 (-5.49%)
Mutual labels:  django
Django X509
Reusable django app implementing x509 PKI certificates management
Stars: ✭ 326 (-0.61%)
Mutual labels:  django
Django Permission
[Not maintained] An enhanced permission system which support object permission in Django
Stars: ✭ 305 (-7.01%)
Mutual labels:  django
Colossus
Self-hosted email marketing solution
Stars: ✭ 319 (-2.74%)
Mutual labels:  django
Mimesis
Mimesis is a high-performance fake data generator for Python, which provides data for a variety of purposes in a variety of languages.
Stars: ✭ 3,439 (+948.48%)
Mutual labels:  fixtures
Django Concurrency
Optimistic lock implementation for Django. Prevents users from doing concurrent editing.
Stars: ✭ 327 (-0.3%)
Mutual labels:  django

Model Bakery: Smart fixtures for better tests

Model Bakery offers you a smart way to create fixtures for testing in Django. With a simple and powerful API you can create many objects with a single line of code.

Model Bakery is a rename of the legacy Model Mommy project.

Tests Latest PyPI version Documentation Status

Install

pip install model_bakery

Usage and Info

Basic usage

# models.py

class Customer(models.Model):
    enjoy_jards_macale = models.BooleanField()
    name = models.CharField(max_length=30)
    email = models.EmailField()
    age = models.IntegerField()
    bio = models.TextField()
    days_since_last_login = models.BigIntegerField()
    birthday = models.DateField()
    last_shopping = models.DateTimeField()

# test_models.py

from django.test import TestCase
from model_bakery import baker
from pprint import pprint

class TestCustomerModel(TestCase):
    def setUp(self):
        self.customer = baker.make('shop.Customer')
        pprint(self.customer.__dict__)

"""
{'_state': <django.db.models.base.ModelState object at 0x1129a3240>,
 'age': 3841,
 'bio': 'vUFzMUMyKzlnTyiCxfgODIhrnkjzgQwHtzIbtnVDKflqevczfnaOACkDNqvCHwvtWdLwoiKrCqfppAlogSLECtMmfleeveyqefkGyTGnpbkVQTtviQVDESpXascHAluGHYEotSypSiHvHzFteKIcUebrzUVigiOacfnGdvijEPrZdSCIIBjuXZMaWLrMXyrsUCdKPLRBRYklRdtZhgtxuASXdhNGhDsrnPHrYRClhrSJSVFojMkUHBvSZhoXoCrTfHsAjenCEHvcLeCecsXwXgWJcnJPSFdOmOpiHRnhSgRF',
 'birthday': datetime.date(2019, 12, 3),
 'enjoy_jards_macale': True,
 'id': 1,
 'last_shopping': datetime.datetime(2019, 12, 3, 21, 42, 34, 77019),
 'name': 'qiayYnESvqcYLLBzxpFOcGBIfnQEPx',
 'days_since_last_login': 6016}
"""

Check out documentation for more complete examples.

Contributing

Detailed info here.

Maintainers

Creator

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].