Skip to main content
django-easy-fixture
===================
.. figure:: https://travis-ci.org/allenling/django-easy-fixture.svg?branch=master

python2.7, python3.5

1.8<= Django <= 1.10

**install: pip install django-easy-fixture**

That is a easy, simple tool to help you to fill your fixture dict with some spam datas

Make your fixture dict to be a completely available django fixture that **you do not have to worry about any unqiue, unqie_together, just pk**

**The pk must be defined by you!**

**Just support all the fields defined by Django, and do not support any customization field.**

**Maybe** support the customization field in the future.



1. get a fixture dict
---------------------

.. code-block:: python

# in template.py
fixtures_template={'auth.User': [{'pk': 1}]}

# in other.py
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
------------------------------

.. code-block:: python

# in template.py
fixtures_template = {'auth.User': [{'pk': 1}]}

# in your settings.py
INSTALLED_APPS = ('other apps',
'easy_fixture',
)
run make_fixture command

.. code-block:: python

python manage.py make_fixture template.fixtures_template > /path/to/fixture.json

Must pass the module path and fixture variable, like module.to.fixture.Variable_name

**do not support old style**

.. code-block:: python

python manage.py make_fixture template > /path/to/fixture.json

3. use in test
--------------

In your testCase, call EasyFixture.load_into_testcase in your setUpTestData, setUpClass, setUp or anywhere you want to load your fixture data.

.. code-block:: python

FIXTURE_DICT = {'auth.User': [{'pk': 1}]}

class MyTestCase(TestCase):

@classmethod
def setUpTestData(cls):
ef = EasyFixture(FIXTURE_DICT)
ef.load_into_testcase()
TestCase.setUpTestData()

def tes_what_you_want(self):
pass


**deprecate**

.. code-block:: python

from easy_fixture.easy_fixture import FixtureFileGen

class MyCase(TestCase):
fixtures = FixtureFileGen(['my.fixture.template.module'])

Metadata

Release files for django-easy-fixture 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-easy-fixture 0.3.0
File Size Uploaded Provenance
django-easy-fixture-0.3.0.tar.gz 13.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for django-easy-fixture 0.3.0
File Interpreter ABI Platform
django_easy_fixture-0.3.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 20.0 kB

Release files / django-easy-fixture-0.3.0.tar.gz

Download URL django-easy-fixture-0.3.0.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
901f3d295ecee0b923271f9ae664be7f50c22bcdd8a299c8fae8d1cc2817a1d0
BLAKE2b-256 checksum
How to use checksums
10121f29dc0331cd99e333e991661522d938a0b2d1bfb59467ab546722557b98
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_easy_fixture-0.3.0-py2.py3-none-any.whl

Download URL django_easy_fixture-0.3.0-py2.py3-none-any.whl
Size 6.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
22a044667badc859507f9a06ff75ee179be7647e072e159c36eb35ffd436c4ad
BLAKE2b-256 checksum
How to use checksums
83d3a5341c409a8cd0e211aa6a52876069f949f68a0d87447493fc19c9745c95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-easy-fixture 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page