|
5 | 5 | [](https://pypi.python.org/pypi/model_bakery/)
|
6 | 6 | [](https://model-bakery.readthedocs.io/en/latest/?badge=latest)
|
7 | 7 |
|
8 |
| -*Model Bakery* offers you a smart way to create fixtures for testing in |
9 |
| -Django. |
10 |
| -With a simple and powerful API you can create many objects with a single |
11 |
| -line of code. |
| 8 | +*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. |
12 | 9 |
|
13 |
| -Model Bakery is a rename of the legacy [Model Mommy project](https://pypi.org/project/model_mommy/). |
| 10 | +> **Note:** Model Bakery is a rename of the legacy [Model Mommy project](https://pypi.org/project/model_mommy/). |
14 | 11 |
|
15 |
| -## Install |
| 12 | +## Installation |
16 | 13 |
|
17 | 14 | ```bash
|
18 | 15 | pip install model-bakery
|
19 | 16 | ```
|
20 | 17 |
|
21 |
| -## Usage and Info |
22 |
| - |
23 |
| -### Basic usage |
| 18 | +## Basic usage |
24 | 19 |
|
25 | 20 | ```python
|
26 |
| - |
27 | 21 | # models.py
|
28 |
| - |
29 | 22 | from django.db import models
|
30 | 23 |
|
31 | 24 | class Customer(models.Model):
|
32 |
| - enjoy_jards_macale = models.BooleanField() |
33 | 25 | name = models.CharField(max_length=30)
|
34 | 26 | email = models.EmailField()
|
35 | 27 | age = models.IntegerField()
|
| 28 | + is_jards_macale_fan = models.BooleanField() |
36 | 29 | bio = models.TextField()
|
37 |
| - days_since_last_login = models.BigIntegerField() |
38 | 30 | birthday = models.DateField()
|
39 | 31 | last_shopping = models.DateTimeField()
|
40 | 32 |
|
41 | 33 | # test_models.py
|
42 |
| - |
43 | 34 | from django.test import TestCase
|
44 | 35 | from model_bakery import baker
|
45 |
| -from pprint import pprint |
46 | 36 |
|
47 | 37 | class TestCustomerModel(TestCase):
|
48 | 38 | def setUp(self):
|
49 | 39 | self.customer = baker.make('shop.Customer')
|
50 |
| - pprint(self.customer.__dict__) |
| 40 | + print(self.customer.__dict__) |
51 | 41 |
|
52 | 42 | """
|
53 | 43 | {'_state': <django.db.models.base.ModelState object at 0x1129a3240>,
|
54 | 44 | 'age': 3841,
|
55 | 45 | 'bio': 'vUFzMUMyKzlnTyiCxfgODIhrnkjzgQwHtzIbtnVDKflqevczfnaOACkDNqvCHwvtWdLwoiKrCqfppAlogSLECtMmfleeveyqefkGyTGnpbkVQTtviQVDESpXascHAluGHYEotSypSiHvHzFteKIcUebrzUVigiOacfnGdvijEPrZdSCIIBjuXZMaWLrMXyrsUCdKPLRBRYklRdtZhgtxuASXdhNGhDsrnPHrYRClhrSJSVFojMkUHBvSZhoXoCrTfHsAjenCEHvcLeCecsXwXgWJcnJPSFdOmOpiHRnhSgRF',
|
56 | 46 | 'birthday': datetime.date(2019, 12, 3),
|
57 |
| - 'enjoy_jards_macale': True, |
| 47 | + |
| 48 | + 'is_jards_macale_fan': True, |
58 | 49 | 'id': 1,
|
59 | 50 | 'last_shopping': datetime.datetime(2019, 12, 3, 21, 42, 34, 77019),
|
60 |
| - 'name': 'qiayYnESvqcYLLBzxpFOcGBIfnQEPx', |
61 |
| - 'days_since_last_login': 6016} |
| 51 | + 'name': 'qiayYnESvqcYLLBzxpFOcGBIfnQEPx'} |
62 | 52 | """
|
63 |
| - |
64 | 53 | ```
|
65 | 54 |
|
66 |
| -Check out [documentation](<http://model-bakery.readthedocs.org/>) for more complete examples. |
| 55 | +## Documentation |
| 56 | + |
| 57 | +For more detailed information, check out the [full documentation](https://model-bakery.readthedocs.io/). |
67 | 58 |
|
68 | 59 | ## Contributing
|
69 | 60 |
|
70 |
| -Detailed info [here](https://github.com/model-bakers/model_bakery/blob/main/CONTRIBUTING.md). |
| 61 | +As an open-source project, Model Bakery welcomes contributions of many forms: |
| 62 | + |
| 63 | +- Code patches |
| 64 | +- Documentation improvements |
| 65 | +- Bug reports |
| 66 | + |
| 67 | +Take a look at our [contribution guidelines](https://github.com/model-bakers/model_bakery/blob/main/CONTRIBUTING.md) for instructions |
| 68 | +on how to set up your local environment. |
71 | 69 |
|
72 | 70 | ## Maintainers
|
73 | 71 |
|
74 |
| - - [Bernardo Fontes](https://github.com/berinhard/) |
75 |
| - - [Rustem Saiargaliev](https://github.com/amureki/) |
76 |
| - - [Tim Klein](https://github.com/timjklein36) |
| 72 | +- [Bernardo Fontes](https://github.com/berinhard/) |
| 73 | +- [Rustem Saiargaliev](https://github.com/amureki/) |
| 74 | +- [Tim Klein](https://github.com/timjklein36) |
77 | 75 |
|
78 | 76 | ## Creator
|
79 | 77 |
|
80 |
| - - [Vanderson Mota](https://github.com/vandersonmota/) |
| 78 | +- [Vanderson Mota](https://github.com/vandersonmota/) |
| 79 | + |
| 80 | +## License |
| 81 | + |
| 82 | +Model Bakery is licensed under the MIT License. |
| 83 | +See the [LICENSE](https://github.com/model-bakers/model_bakery/blob/main/LICENSE) file for more information. |
0 commit comments