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 that you do not have to worry about any unqiue, unqie_together
install: pip install django-easy-fixture
1. output a fixture dict
pk must be set by yourself
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
pk must be set by yourself
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.2.0.tar.gz
(13.7 kB
view hashes)
Built Distribution
Close
Hashes for django-easy-fixture-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33dc7ec61ed2064dfaeb321e4469787a5dee30313c9257cd3866bd540ac69d56 |
|
MD5 | 69f00cbae4a9801ea510662b2be592c0 |
|
BLAKE2b-256 | 10d3eea44d050cf8b8fb85891147adf8797147f3cd7ce2246859356a5e32e9ed |
Close
Hashes for django_easy_fixture-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 712643af64f654ac6827b2d65a85824bf8e191667dadf57e3a7658f121197294 |
|
MD5 | 584f3463f4ebf983ea2a45036f313549 |
|
BLAKE2b-256 | 53354956c724ff53f398124a15f86d84133a7173b9ea6c16820922880b74a7f0 |