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
Close
Hashes for django_fake_model-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11d6a92e33112f060fc27995ab219138a3d845aacc57ca913708d5cdf19cd95b |
|
MD5 | 3715793156e79fe55e3feac3ecc96737 |
|
BLAKE2b-256 | ffc01361346b8aabedcfc9b7b3c888e3e9eb4a10430c2c8589a51c626deea3b9 |