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
Built Distribution
Close
Hashes for django-easy-fixture-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3438bc1e5017a2178b1395ff4a9b90b23f1ecd4c8a6cbb9a2f346ad06d6687a5 |
|
MD5 | 812176dda69e5c5e21e0c6f4dfef2517 |
|
BLAKE2b-256 | 1a5f2d0bfa7cabbc1237ab1956fde20ea08ff6cdd8b6d0fbf79682e0dbd9aa71 |
Close
Hashes for django_easy_fixture-0.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d030088662f781eb2fe4f4e6c1b9be2e0b631f1331b7dd5248d1b799f126bbf2 |
|
MD5 | 1016e1b7c56c4a4ff8aac785ec0b5e0a |
|
BLAKE2b-256 | 89d116a9ee0532b0ba2188f17d98b453f242677c9b51103289edee4a33ec6dbc |