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
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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24a7cb529eeff5bdfedb420c9d7a32fbaa47963233cda0524478a6d2d9f1dbca |
|
MD5 | 30edbbaa281316884cea11908364d9e7 |
|
BLAKE2b-256 | 3ad1cbb52b90e532383b1ee43700a0521e55f8262833022c10303ddbce541d84 |
Close
Hashes for django_easy_fixture-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4fd7401107bfb3ccf17d5025cf33c9ffbdc66daaccb535117874217d62555e7 |
|
MD5 | 6db135b10683fbaea7de3817adf21b86 |
|
BLAKE2b-256 | e2090e605cf45060611e63c55c48078b8b5606322c7762e26e7cecea147e6ded |