easy to create a django fixture
Project description
for python2.7, python3.5 and Django>=1.8
create a fixture dict that just include some fields you concern, and we will help you to fill your fixture dict with some spam datas that make your fixture dict to be a completely available django fixture
install: pip install django-easy-fixture
1. output a fixture dict
in template.py
fixtures_template={'auth.User': [{'pk': 1}]}
then
from easy_fixture.easy_fixture import EasyFixture
from template import fixtures_template
ef = EasyFixture(fixtures_template)
fixtures_dict = ef.output()
2. use as a django app command
2.1. create a simple fixture template
in template.py
fixtures_template={'auth.User': [{'pk': 1}]}
2.2. in settings.py
INSTALLED_APPS = ('other apps',
'easy_fixture',
)
2.3. run command
python manage.py make_fixture template > /path/to/fixture.json
3. use in test
from easy_fixture.easy_fixture import FixtureFileGen
class MyCase(TestCase):
fixtures = FixtureFileGen(['my.fixture.template.module'])
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
django-easy-fixture-0.1.3.tar.gz
(13.1 kB
view hashes)
Built Distribution
Close
Hashes for django-easy-fixture-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae4e6a3fb4d1a9972b987c5d48cdc9e2647f0af910285e5faffccec4b92f5528 |
|
MD5 | bd379a61360c8b77300465123992bce5 |
|
BLAKE2b-256 | 1c9eb24a8847b8347ff27a812312501a59b9c7fd55c5e7847d5ee78eb4623e48 |
Close
Hashes for django_easy_fixture-0.1.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3786465079af184e673a2ba40c75b4cc7008a604671024d8a382cd6a7b715d92 |
|
MD5 | c01e0789f47885005b9d377608a6e56d |
|
BLAKE2b-256 | 2e1ba0a4d4775fd38326d15f5a409a2254d7167eba579275c7d0f3a691fadc15 |