Simple library for creating fake models in the unit tests.
Project description
Simple library for creating fake models in the unit tests.
Quickstart
Install django-fake-model:
pip install django-fake-model
Then use it in a project:
from django_fake_model import models as f from django.db import models from django.test import TestCase class MyFakeModel(f.FakeModel): name = models.CharField(max_length=100) @MyFakeModel.fake_me class MyFakeModelTests(TestCase): def test_create_model(self): MyFakeModel.objects.create(name='123') model = MyFakeModel.objects.get(name='123') self.assertEqual(model.name, '123') class MyFakeModelFunctionTest(TestCase): @MyFakeModel.fake_me def test_create_model(self): MyFakeModel.objects.create(name='123') model = MyFakeModel.objects.get(name='123') self.assertEqual(model.name, '123')
Features
TODO
History
0.1.0 (2015-09-16)
First release on PyPI.
Project details
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
File details
Details for the file django-fake-model-0.1.0.tar.gz
.
File metadata
- Download URL: django-fake-model-0.1.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89299bd5ee61a41e652f623785edb6aa285c3cff271e1c3cfd7ed4c7dfbf467a |
|
MD5 | 50eb03b6bf8a4a1e993c22b9bb527fef |
|
BLAKE2b-256 | 9dfb85d914694bd8982d85cbf53f15fff5c15c4a4a40c18b416de84857c93e90 |
File details
Details for the file django_fake_model-0.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: django_fake_model-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11d6a92e33112f060fc27995ab219138a3d845aacc57ca913708d5cdf19cd95b |
|
MD5 | 3715793156e79fe55e3feac3ecc96737 |
|
BLAKE2b-256 | ffc01361346b8aabedcfc9b7b3c888e3e9eb4a10430c2c8589a51c626deea3b9 |